LangChain's XMLOutputParser vulnerable to XML Entity Expansion
Medium5.9CVE-2024-1455 · Published Mar 26, 2024 · updated Jul 7, 2026
The XMLOutputParser in LangChain uses the etree module from the XML parser in the standard python library which has some XML vulnerabilities; see: https://docs.python.org/3/library/xml.html This primarily affects users that combine an LLM (or agent) with the `XMLOutputParser` and expose the component via an endpoint on a web-service. This would allow a malicious party to attempt to manipulate the LLM to produce a malicious payload for the parser that would compromise the availability of the service. A successful attack is predicated on: 1. Usage of XMLOutputParser 2. Passing of malicious input into the XMLOutputParser either directly or by trying to manipulate an LLM to do so on the users behalf 3. Exposing the component via a web-service
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| langchain-core PyPI | < 0.1.35 | 0.1.35 |
Details and references
- CVSS 3.0
- CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-776
- Also known as
- CVE-2024-1455, PYSEC-2026-1519
- nvd.nist.gov/vuln/detail/CVE-2024-1455
- github.com/langchain-ai/langchain/pull/17250
- github.com/langchain-ai/langchain/pull/19653
- github.com/langchain-ai/langchain/pull/19660
- github.com/langchain-ai/langchain/commit/727d5023ce88e18e3074ef620a98137d26ff92a3
- github.com/langchain-ai/langchain
- huntr.com/bounties/4353571f-c70d-4bfd-ac08-3a89cecb45b6
More LangChain advisories
All LangChain| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Jun 62024 | Server-Side Request Forgery in langchain-community.retrievers.web_research.WebResearchRetriever | Medium4.8 | 0.2.9 |
| Apr 162024 | langchain vulnerable to path traversal | Medium6.5 | 0.0.353 |
| Mar 42024 | LangChain directory traversal vulnerability | Low | 0.0.339+1 more |
| Mar 12024 | LangChain: server-side request forgery | Critical9.8 | No fix yet |
| Feb 262024 | LangChain Experimental vulnerable to arbitrary code execution | Critical9.8 | 0.0.52 |
| Feb 262024 | langchain Server-Side Request Forgery vulnerability | Low3.7 | 0.1.0 |