CVE-2024-1455: LangChain's XMLOutputParser vulnerable to XML Entity Expansion
Summary
CVE-2024-1455: LangChain's XMLOutputParser vulnerable to XML Entity Expansion. Affects langchain-core versions < 0.1.35. Fixed in 0.1.35. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
LangChain is a package available on PyPI that provides functionality for XML parsing and manipulation. It includes the XMLOutputParser component, which utilizes the etree module from the XML parser in the standard Python library. This module has known vulnerabilities related to XML parsing. More information about these vulnerabilities can be found in the Python documentation (https://docs.python.org/3/library/xml.html). The vulnerability primarily affects users who combine an LLM (or agent) with the XMLOutputParser and expose the component via an endpoint on a web service.
Vulnerability Detail
The XMLOutputParser in LangChain is vulnerable to XML Entity Expansion. This vulnerability allows an attacker to manipulate the LLM or input data to produce a malicious payload for the parser. By exploiting this vulnerability, an attacker can compromise the availability of the service. To successfully exploit the vulnerability, the following conditions must be met: 1. The XMLOutputParser is being used. 2. Malicious input is passed into the XMLOutputParser directly or by manipulating an LLM. 3. The component is exposed via a web service.
How To Fix
Latest published version: 1.7.0 as of 22 Oct 2026
pip install --upgrade "langchain-core==1.7.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.1.35
This is the first release that contains the fix.
pip install --upgrade "langchain-core==0.1.35"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is necessary to update the LangChain package to the fixed version to mitigate the risk.
Conclusion
In conclusion, LangChain's XMLOutputParser is vulnerable to XML Entity Expansion, which can be exploited to compromise the availability of a service. To mitigate this vulnerability, it is recommended to update the LangChain package to version 0.1.34 or later. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for langchain-core →
FAQ
LangChain is a package available on PyPI that provides functionality for XML parsing and manipulation.
XMLOutputParser is a component in LangChain that utilizes the etree module from the XML parser in the standard Python library.
XML Entity Expansion is a vulnerability that allows an attacker to manipulate XML input to cause excessive memory consumption and potential denial of service.
This vulnerability can be exploited by passing malicious input into the XMLOutputParser, either directly or by manipulating an LLM (or agent) to do so.
The impact of this vulnerability is the potential compromise of the availability of the service that uses LangChain and XMLOutputParser.
References
Related vulnerabilities
Recent vulnerabilities recorded for langchain-core.