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.
Published: 2026-06-01
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Tue, 02 Jun 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 02 Jun 2026 00:15:00 +0000

Type Values Removed Values Added
First Time appeared Langroid
Langroid langroid
Vendors & Products Langroid
Langroid langroid

Mon, 01 Jun 2026 22:30:00 +0000

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'}


Subscriptions

Langroid Langroid
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-06-02T15:45:42.697Z

Reserved: 2026-02-06T21:08:39.128Z

Link: CVE-2026-25879

cve-icon Vulnrichment

Updated: 2026-06-02T15:08:48.516Z

cve-icon NVD

Status : Deferred

Published: 2026-06-01T23:16:21.930

Modified: 2026-06-02T17:16:27.750

Link: CVE-2026-25879

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-02T00:15:41Z

Weaknesses