CVE-2024-1455: LangChain's XMLOutputParser vulnerable to XML Entity Expansion
LangChain's XMLOutputParser in langchain-core before 0.1.35 parses text with Python's standard-library etree module, which is open to XML entity expansion. Someone who can feed or steer the XML the parser receives can make the service unavailable. Upgrade langchain-core to 0.1.35.
Published Mar 26, 2024 · Updated Mar 27, 2024 · Analysis Nov 2, 2026
What an attacker can do
XMLOutputParser takes the model's output and parses it as XML with the etree module from the Python standard library. The Python documentation lists known XML weaknesses for that module, including entity expansion, where small nested entity definitions expand into very large strings and consume memory and CPU.
The attack needs three things, according to the advisory: the app uses XMLOutputParser, malicious input reaches the parser directly or through an LLM manipulated into emitting it, and the component is exposed through a web service. An attacker prompts the model, or plants text in content the model reads, so that the output carries an entity-expansion payload. The parser then expands it. The result is a denial of service on the endpoint. The advisory says it affects availability only. The CVSS vector marks attack complexity as high, because the attacker has to steer the model first.
Who is affected
langchain-core below 0.1.35, in apps that use XMLOutputParser and expose it, for example through an API that passes user input to an LLM and parses the answer. Apps that never use XMLOutputParser are not exposed through this path.
Check the installed version:
pip show langchain-coreSearch your code for the parser:
grep -rn XMLOutputParser .langchain-core
- Ecosystem
- PyPI
- Affected
- < 0.1.35
- Fixed in
- 0.1.35
- Check
pip show langchain-core
How to fix it
Upgrade to langchain-core 0.1.35:
pip install --upgrade "langchain-core>=0.1.35"The fix is in the pull request titled "Patch XML vulnerability in XMLOutputParser". Its notes describe a potential denial-of-service issue. The sources I could read do not show the code change or give a workaround. As a precaution, do not feed untrusted model output to the parser on a public endpoint until you upgrade.
How to tell if you were hit
Look for requests to the endpoint that run XMLOutputParser followed by memory growth, high CPU or timeouts in the Python worker. Check application logs for parser errors or worker restarts after prompts that ask the model to output XML with a DOCTYPE or entity definitions. Check the langchain-core version in every environment and container image.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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:
- Usage of XMLOutputParser
- Passing of malicious input into the XMLOutputParser either directly or by trying to manipulate an LLM to do so on the users behalf
- Exposing the component via a web-service
Credited to eyurtsev.
Questions
- Does this allow code execution or data theft?
No. The advisory describes a loss of availability only. The CVSS vector has no confidentiality or integrity impact.
- Am I affected if I do not use XMLOutputParser?
The advisory is specific to XMLOutputParser. The attack is predicated on using it, on malicious input reaching it, and on exposing it through a web service.
- Which version fixes CVE-2024-1455?
langchain-core 0.1.35. Anything below it is in the vulnerable range.
References
Read for this analysis:
- https://github.com/advisories/GHSA-q84m-rmw3-4382
- https://github.com/langchain-ai/langchain/pull/19660
- https://nvd.nist.gov/vuln/detail/CVE-2024-1455
- https://huntr.com/bounties/4353571f-c70d-4bfd-ac08-3a89cecb45b6
- https://github.com/langchain-ai/langchain/pull/17250
- https://github.com/langchain-ai/langchain/commit/727d5023ce88e18e3074ef620a98137d26ff92a3
- https://github.com/langchain-ai/langchain/pull/19653
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LangChain vulnerabilities
All LangChain entriesCVE-2026-55443
LangChain: Path traversal and sandbox escape in LangChain file-search middleware and loaders
medium5.1Jun 16, 2026CVE-2026-45134
LangSmith SDK: Public prompt pull deserializes untrusted manifests without trust boundary warning
high7.1May 13, 2026CVE-2026-44843
LangChain vulnerable to unsafe deserialization of attacker-controlled objects through overly broad `load()` allowlists
high8.2May 8, 2026CVE-2026-40087
LangChain has incomplete f-string validation in prompt templates
medium5.3Apr 8, 2026CVE-2026-34070
LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions
high7.5Mar 27, 2026CVE-2026-27795
LangChain Community: redirect chaining can lead to SSRF bypass via RecursiveUrlLoader
medium4.1Feb 25, 2026
