CVE-2025-46726: Langroid Allows XXE Injection via XMLToolMessage
7.8
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
langroid | pip | < 0.53.4 | 0.53.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The analysis began by reviewing the vulnerability description, which clearly indicated that the XMLToolMessage
class was vulnerable due to its use of lxml
without proper safeguards, specifically pointing to the XML parsing logic. The provided commit 36e7e7db4dd1636de225c2c66c84052b1e9ac3c3
was then examined. The commit diff showed modifications in langroid/agent/xml_tool_message.py
directly addressing this issue. The extract_field_values
method within the XMLToolMessage
class was identified as the location of the vulnerable code. The patch modified the initialization of lxml.etree.XMLParser
within this method to include security flags (resolve_entities=False
, load_dtd=False
, no_network=True
) to prevent XXE and related attacks. Therefore, the extract_field_values
method, in its state prior to this patch, is the vulnerable function as it directly handled the insecure parsing of XML input.