Miggo Logo

CVE-2024-1455:
LangChain's XMLOutputParser vulnerable to XML Entity Expansion

5.9

CVSS Score

Basic Information

EPSS Score
-
Published
3/26/2024
Updated
3/27/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
langchain-corepip< 0.1.350.1.35

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from using Python's standard XML parser which is vulnerable to XML Entity Expansion (CWE-776). The patch replaces xml.etree.ElementTree with defusedxml in three key areas: 1) The main parse() method 2) The synchronous _transform() streaming parser 3) The async _atransform() streaming parser. All three functions directly handled XML parsing without proper entity expansion restrictions prior to the patch, making them entry points for denial-of-service attacks via malicious XML payloads.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T** XMLOutputP*rs*r in L*n****in us*s t** *tr** mo*ul* *rom t** XML p*rs*r in t** st*n**r* pyt*on li*r*ry w*i** **s som* XML vuln*r**iliti*s; s**: *ttps://*o*s.pyt*on.or*/*/li*r*ry/xml.*tml T*is prim*rily *****ts us*rs t**t *om*in* *n LLM (or ***nt)

Reasoning

T** vuln*r**ility st*ms *rom usin* Pyt*on's st*n**r* XML p*rs*r w*i** is vuln*r**l* to XML *ntity *xp*nsion (*W*-***). T** p*t** r*pl***s xml.*tr**.*l*m*ntTr** wit* ***us**xml in t*r** k*y *r**s: *) T** m*in p*rs*() m*t*o* *) T** syn**ronous _tr*ns*o