Loading...
Skip to main content

CVE-2025-46726

CRITICAL

Langroid Allows XXE Injection via XMLToolMessage

Published July 7, 2026Updated July 7, 2026Source: osv

Summary

### Summary A LLM application leveraging `XMLToolMessage` class may be exposed to untrusted XML input that could result in DoS and/or exposing local files with sensitive information. ### Details `XMLToolMessage` uses `lxml` without safeguards: https://github.com/langroid/langroid/blob/df6227e6c079ec22bb2768498423148d6685acff/langroid/agent/xml_tool_message.py#L51-L52 `lxml` is vulnerable to quadratic blowup attacks and processes external entity declarations for local files by default. Check here: https://pypi.org/project/defusedxml/#python-xml-libraries ### PoC A typical Quadratic blowup XML payload looks like this: ```xml <!DOCTYPE bomb [ <!ENTITY a "aaaaaaaaaa"> <!ENTITY b "&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;"> <!ENTITY c "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;"> ]> <bomb>&c;</bomb> ``` Here, &a; expands to 10 characters, &b; expands to 100, and &c; expands to 1000, causing exponential memory usage and potentially crashing the application. ### Fix Langroid 0.53.4 initializes `XMLParser` with flags to prevent XML External Entity (XXE), billion laughs, and external DTD attacks by disabling entity resolution, DTD loading, and network access. https://github.com/langroid/langroid/commit/36e7e7db4dd1636de225c2c66c84052b1e9ac3c3

Remediation

Upgrade to the fixed version using your package manager.

pip
Update langroid to 0.53.4 or later
pip install "langroid>=0.53.4"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

PackageEcosystemAffectedFixed In
langroid
pypi
0.1.100, 0.1.101, 0.1.102, 0.1.103 (+434 more)0.53.4

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Confidentiality
Integrity
Availability

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N/E:P

Frequently Asked Questions

What is CVE-2025-46726?
Langroid Allows XXE Injection via XMLToolMessage This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.1/10).
How do I check if my project is affected by CVE-2025-46726?
CVE-2025-46726 affects langroid. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-46726 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.1

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

PYSEC-2026-1532
GHSA-pw95-88fg-3j6f

Related CVEs

  • CVE-2025-46725
    CRITICAL

    Langroid has a Code Injection vulnerability in LanceDocChatAgent through vector_store

  • CVE-2026-55615
    CRITICAL

    Langroid: Neo4jChatAgent executes LLM-generated Cypher without validation (prompt-to-Cypher injection; config-conditional RCE), mirroring the SQLChatAgent bug fixed in CVE-2026-25879

  • CVE-2026-54760
    CRITICAL

    Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls

  • CVE-2025-46724
    CRITICAL

    Langroid has a Code Injection vulnerability in TableChatAgent

  • CVE-2026-25879
    CRITICAL

    Langroid has Prompt to SQL Injection, Leading to RCE

  • CVE-2026-54769
    CRITICAL

    Langroid: Sandbox Escape to Remote Code Execution via Incomplete `eval()` Mitigation in TableChatAgent

  • CVE-2026-25481
    CRITICAL

    Langroid has WAF Bypass Leading to RCE in TableChatAgent

  • CVE-2025-46725
    HIGH

    Langroid has a Code Injection vulnerability in LanceDocChatAgent through vector_store

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies