CVE-2025-46726
JSON

7.8high

Langroid Vulnerable to XXE Injection via XMLToolMessage

Severity
7.8high CVSS:4.0 by GitHub_M
Exploit likelihood
0.67% (higher than 53% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-pw95-88fg-3j6fPYSEC-2026-1532

Description

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.53.4, 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. Version 0.53.4 fixes the issue.

Affected

Product or packageVersionsReported by
langroid langroid< 0.53.4, before 0.53.4CVE List, NVD
langroid (PyPI)before 0.53.4GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M7.8high CVSS:4.0CVSS: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
GitHubhigh CVSS:4.0CVSS: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
NVD9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS: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

Classification

CWE-611

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.53.4, 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. Version 0.53.4 fixes the issue.

GitHub Advisory Database
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

NVD (es)

Langroid es un framework para crear aplicaciones basadas en modelos de lenguaje de gran tamaño. Antes de la versión 0.53.4, una aplicación LLM que utiliza la clase `XMLToolMessage` podía estar expuesta a entradas XML no confiables, lo que podía provocar un ataque de denegación de servicio (DoS) o la exposición de archivos locales con información confidencial. La versión 0.53.4 soluciona este problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-46726 changed 2025-05-05CVE Terms of Use
GitHub Advisory DatabaseGHSA-pw95-88fg-3j6f changed 2026-07-07CC-BY-4.0
NVDCVE-2025-46726 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1532 changed 2026-07-07CC-BY-4.0