Safeguard
Vulnerability Analysis•

CVE-2025-46725: Critical Code Injection in Langroid LanceDocChatAgent

CVE-2025-46725: Langroid before 0.53.15 runs pandas eval on query plan input in LanceDocChatAgent. Upgrade to 0.53.15 and keep inputs trusted.

Safeguard Security Team
4 min read

CVE-2025-46725 is a critical code injection flaw (CVSS 9.8) in Langroid before 0.53.15. LanceDocChatAgent passes model-influenced input to pandas eval(), so an attacker may be able to run commands on the host. Upgrade to 0.53.15, which sanitises the input by default, and read the documentation warnings.

What's affected

The NVD record says Langroid versions before 0.53.15 are affected, and the GitHub advisory names 0.53.15 as the patched release. Langroid is a Python framework for building applications powered by large language models.

The affected component is LanceDocChatAgent, in its compute_from_docs() function. That function evaluates a dataframe calculation string through pandas eval(). The advisory says the string can come through the QueryPlan.dataframe_calc field, which a language model produces from user input.

The fix sanitises input to the function by default to handle the most common attack vectors, and the project added warnings to its documentation about the risk. Read those warnings: the project signals that the design carries risk, not only that one bug is closed.

How to check if you're exposed

Check the installed version in every Python environment and container.

  • Run pip show langroid and read the Version line.
  • Run pip freeze | grep -i langroid to list it in a virtual environment.
  • For lock files, search with grep -n langroid requirements.txt poetry.lock uv.lock.
  • Check whether your code uses LanceDocChatAgent. A search such as grep -rn LanceDocChatAgent . shows usage.

Any version before 0.53.15 is affected. If you do not use LanceDocChatAgent, the vulnerable function is likely not on your execution path, which is what reachability analysis is meant to tell you. The free in-browser dependency scan can read your requirements file in the browser and flag the version.

What to do now

  1. Upgrade Langroid to 0.53.15 or later in all environments and rebuild images.
  2. Read the new documentation warnings about the risky behaviour and decide whether LanceDocChatAgent fits your threat model.
  3. Run agents that evaluate model-produced expressions in a sandbox with no secrets, minimal network access and a low privilege account.
  4. Do not give the agent access to documents or queries that come from untrusted users without review.
  5. Log the dataframe calculations that the agent runs, so unusual ones stand out.
  6. Pin Langroid in your lock file and enable automated alerts for new releases.

Why it matters

The record lists CWE-94 (Improper Control of Generation of Code (Code Injection)). Code injection happens when text that someone else controls is run as code. With language model applications there is an extra step: the model turns a user's request into the expression, so a user can steer what gets evaluated through the prompt.

The vector (AV:N, AC:L, PR:N, UI:N) reflects that an agent exposed to users may be reachable by anyone. The project's fix filters common attack patterns, and its documentation now warns about the behaviour, so teams should still isolate agents that run generated expressions. The record does not mark this CVE as exploited in the wild, and it is not on the CISA Known Exploited Vulnerabilities list.

Try it yourself

The demo shows how reachability analysis separates flaws in code your application calls from flaws in code it never uses.

Click through it at your own pace, or open it full screen.

Quick check

Which version fixes it?

Langroid 0.53.15, according to the advisory.

Is the fix a complete cure?

The advisory says the fix sanitises input by default to tackle the most common attack vectors and adds documentation warnings. Keep sandboxing in place.

Sources

Last reviewed: 18 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.