CVE-2026-25879 Langroid has Prompt to SQL Injection, Leading to RCE
Attackers can achieve remote code execution on the database host via prompt injection in Langroid's SQLChatAgent when dangerous database privileges are enabled.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-25879?
CVE-2026-25879 is a critical SQL injection vulnerability in langroid, published on 1 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Langroid is a framework for building large-language-model-powered applications. Prior to version 0.63.0, SQLChatAgent executes SQL produced by an LLM, which is influenceable by prompt injection. When configured with a database role that has privileges enabling code execution or filesystem access (e.g., PostgreSQL pg_execute_server_program, MySQL FILE, MSSQL xp_cmdshell), an attacker who can shape the agent's input — including indirectly via data returned to the LLM — can coerce execution of dialect-specific primitives such as `COPY ... FROM PROGRAM`, achieving RCE on the database host. Fixed in v0.63.0 by defaulting SQLChatAgent to a SELECT-only sqlglot-parsed statement allowlist with a dialect-aware dangerous-pattern blocklist; allow_dangerous_operations=True restores the previous unrestricted behavior for trusted deployments.
Which versions are affected by CVE-2026-25879?
3 open source packages ship an affected version, including langroid.
| Package | Affected | Fixed in |
|---|---|---|
langroid PyPI | All versions | 0.63.0 |
langroid PyPI | All versions | 0.63.0 |
langroid PyPI | All versions | 0.63.0 |
How do I fix CVE-2026-25879?
Upgrade langroid to 0.63.0 or later.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2026-25879 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-25879 exists.
Sources
Also known as GHSA-mxfr-6hcw-j9rq, PYSEC-2026-382.