{"id":"CVE-2025-46726","aliases":["CVE-2025-46726","GHSA-pw95-88fg-3j6f","PYSEC-2026-1532"],"related":[],"kind":"vulnerability","state":"published","title":"Langroid Vulnerable to XXE Injection via XMLToolMessage","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nA 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.\n\n### Details\n`XMLToolMessage` uses `lxml` without safeguards:\nhttps://github.com/langroid/langroid/blob/df6227e6c079ec22bb2768498423148d6685acff/langroid/agent/xml_tool_message.py#L51-L52\n`lxml` is vulnerable to quadratic blowup attacks and processes external entity declarations for local files by default. \nCheck here: https://pypi.org/project/defusedxml/#python-xml-libraries\n\n### PoC\nA typical Quadratic blowup XML payload looks like this:\n```xml\n<!DOCTYPE bomb [\n<!ENTITY a \"aaaaaaaaaa\">\n<!ENTITY b \"&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;\">\n<!ENTITY c \"&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;\">\n]>\n<bomb>&c;</bomb>\n```\nHere, &a; expands to 10 characters, &b; expands to 100, and &c; expands to 1000, causing exponential memory usage and potentially crashing the application.\n \n### Fix\nLangroid 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.\nhttps://github.com/langroid/langroid/commit/36e7e7db4dd1636de225c2c66c84052b1e9ac3c3","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-05-05T19:21:19.597Z","modified":"2026-07-07T17:56:21.504Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-611"],"affected":[{"ranges":[{"version":"< 0.53.4","status":"affected"}],"vendor":"langroid","product":"langroid","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.53.4"}],"ecosystem":"PyPI","package":"langroid","purl":"pkg:pypi/langroid","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.53.4"}],"vendor":"langroid","product":"langroid","cpe":"cpe:2.3:a:langroid:langroid:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.53.4"}],"ecosystem":"PyPI","package":"langroid","purl":"pkg:pypi/langroid","source":"pysec"}],"references":[{"url":"https://github.com/langroid/langroid/security/advisories/GHSA-pw95-88fg-3j6f","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/langroid/langroid/commit/36e7e7db4dd1636de225c2c66c84052b1e9ac3c3","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/langroid/langroid/blob/df6227e6c079ec22bb2768498423148d6685acff/langroid/agent/xml_tool_message.py#L51-L52","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46726","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/langroid/langroid","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/langroid","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-pw95-88fg-3j6f","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-05-05T20:06:52.671Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-46726","url":"https://www.cve.org/CVERecord?id=CVE-2025-46726","licence":"CVE Terms of Use","modified":"2025-05-05T20:07:01.257Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pw95-88fg-3j6f","url":"https://github.com/advisories/GHSA-pw95-88fg-3j6f","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:21.504Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-46726","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46726","licence":"Public domain","modified":"2026-06-17T09:26:53.027Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1532","url":"https://osv.dev/vulnerability/PYSEC-2026-1532","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:49.953Z"}],"updatedAt":"2026-11-25T22:58:57.606Z","epss":{"score":0.00672,"percentile":0.53353,"date":"2026-12-01T12:00:22.000Z"}}