CVE-2025-46726 — Vulnerability in langroid — CVE Details
Langroid Allows XXE Injection via XMLToolMessage
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.03%). Schedule for your next planned update.
Does your project use an affected langroid version?
Paste your requirements.txt to check it for CVE-2025-46726 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
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:
<!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
Advisory Timeline
- First published July 7, 2026 (142 days ago).
- Last revised July 7, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "langroid>=0.53.4"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| langroid PyPI · Affected: 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.
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
References
- https://github.com/langroid/langroid/security/advisories/GHSA-pw95-88fg-3j6fWEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-46726ADVISORY
- https://github.com/langroid/langroid/commit/36e7e7db4dd1636de225c2c66c84052b1e9ac3c3WEB
- https://github.com/langroid/langroidPACKAGE
- https://github.com/langroid/langroid/blob/df6227e6c079ec22bb2768498423148d6685acff/langroid/agent/xml_tool_message.py#L51-L52WEB
- https://pypi.org/project/langroidPACKAGE
- https://github.com/advisories/GHSA-pw95-88fg-3j6fADVISORY
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. It has a 1.0% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-46726 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is an above-median EPSS score — 63% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2025-46725CRITICAL
Langroid has a Code Injection vulnerability in LanceDocChatAgent through vector_store
- CVE-2026-55615CRITICAL
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-54760CRITICAL
Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls
- CVE-2025-46724CRITICAL
Langroid has a Code Injection vulnerability in TableChatAgent
- CVE-2026-25879CRITICAL
Langroid has Prompt to SQL Injection, Leading to RCE
- CVE-2026-54769CRITICAL
Langroid: Sandbox Escape to Remote Code Execution via Incomplete `eval()` Mitigation in TableChatAgent
- CVE-2026-25481CRITICAL
Langroid has WAF Bypass Leading to RCE in TableChatAgent
- CVE-2025-46725HIGH
Langroid has a Code Injection vulnerability in LanceDocChatAgent through vector_store