CVE-2026-25879

Langroid has Prompt to SQL Injection, Leading to RCE

Published Jun 1, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Langroid’s SQLChatAgent, prior to version 0.63.0, constructs and executes SQL statements directly from untrusted language‑model output. The framework accepts user prompts that can influence the LLM’s generated SQL, and, if the underlying database user possesses elevated privileges, the agent can execute dialect‑specific commands such as "COPY … FROM PROGRAM" or other server‑side primitives. This allows an attacker to run arbitrary code or access the file system on the database host, compromising confidentiality, integrity, and availability of the affected system. The weakness corresponds to CWE‑89 (SQL Injection) and CWE‑94 (Code Execution from Unsanitized Input).

Affected Systems

The vulnerability affects the Langroid framework (langroid:langroid) on all releases newer than 0.0.0 but older than 0.63.0. End‑point applications using SQLChatAgent with database roles that include execution or filesystem access (e.g., PostgreSQL pg_execute_server_program, MySQL FILE, MSSQL xp_cmdshell) are susceptible; versions 0.63.0 and later have mitigations enabled by default.

Risk and Exploitability

With a CVSS score of 9.8, the vulnerability is considered critical. No EPSS data is available, so the likelihood of exploitation cannot be quantified, yet the lack of a KEV listing does not diminish the urgency. The most probable attack vector is an attacker who can craft or influence prompts sent to the SQLChatAgent, either directly or via intermediary data returned to the LLM. Successful exploitation requires that the database role used by the agent has expanded privileges, a condition that is not mitigated by standard least‑privilege configurations.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Langroid to version 0.63.0 or later where SQLChatAgent enforces a SELECT‑only statement allowlist and blocks dangerous dialect patterns.
  • If the deployment requires the previously unrestricted behavior, explicitly set allow_dangerous_operations=True only after confirming that the database role has minimal privileges.
  • Restrict the database role used by SQLChatAgent to read‑only permissions, removing any execution or filesystem access capabilities, to further reduce the attack surface.

Generated by OpenCVE AI on June 2, 2026 at 00:05 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-mxfr-6hcw-j9rq Langroid has Prompt to SQL Injection, Leading to RCE
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Langroid
Langroid langroid
Vendors & Products Langroid
Langroid langroid
Type Values Removed Values Added
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.
Title Langroid has Prompt to SQL Injection, Leading to RCE
Weaknesses CWE-89
CWE-94
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 2, 2026, 3:45 PM
Reserved
Feb 6, 2026, 9:08 PM
Status
Deferred
Published
Jun 1, 2026, 11:16 PM
Modified
Jul 21, 2026, 7:10 PM