PyPI: langchain-core

CVE-2024-1455

Safety vulnerability ID: SFTY-20240326-88331

Safety legacy ID: pyup.io-71610

Affected versions of the langchain package are vulnerable to XML External Entity (XXE) Injection due to unrestricted XML entity expansion in the langchain_core.output_parsers.xml.XMLOutputParser component. The XMLOutputParser.parse, _transform, and _atransform implementations rely on xml.etree.ElementTree.fromstring and XMLPullParser without prohibiting entity expansion, allowing recursive entity references (Billion Laughs) to be processed.

Created at: Nov 5, 2025Updated at: Nov 5, 2025

Overview

LangChain's XMLOutputParser vulnerable to XML Entity Expansion

Advisory

Affected versions of the langchain package are vulnerable to XML External Entity (XXE) Injection due to unrestricted XML entity expansion in the langchain_core.output_parsers.xml.XMLOutputParser component. The XMLOutputParser.parse, _transform, and _atransform implementations rely on xml.etree.ElementTree.fromstring and XMLPullParser without prohibiting entity expansion, allowing recursive entity references (Billion Laughs) to be processed.

Affected Package

Affecting langchain-core package, versions
<0.1.35

Also affects

---

How to Fix

Upgrade
langchain-core
to
0.1.35
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more