Description
Langroid is a framework for building large-language-model-powered applications. Prior to version 0.65.1, the `SQLChatAgent` SQL-injection mitigation, with default `allow_dangerous_operations=False`, combines a raw-text regex blocklist (`_DANGEROUS_SQL_PATTERNS`) with a `sqlglot` SELECT-only statement allowlist. The blocklist entries that target callable functions require the function name to be immediately followed by `\s*\(`. PostgreSQL accepts the same call with the name separated from `(` by a quoted identifier, an inline comment, or schema qualification. These forms evade the regex, still parse as `SELECT`, and execute the same PostgreSQL function. This restores the `pg_read_file` server-side file-read primitive that the prior CVE-2026-25879 / GHSA-pmch-g965-grmr fix was meant to block: the parent advisory fixed a missing `pg_read_file` blocklist entry, while this report shows that the added regex is bypassable. Version 0.65.1 fixes the issue.
Published: 2026-07-09
Score: 9.3 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Langroid’s SQLChatAgent component attempts to mitigate SQL injection by using a regular‑expression blocklist of dangerous PostgreSQL functions and a SELECT‑only allowlist. The blocklist requires the function name to be immediately followed by an opening parenthesis, but PostgreSQL accepts several syntactic variants—quoted identifiers, inline comments, or schema-qualified names—that bypass the regex yet still parse as SELECT. This allows execution of functions such as pg_read_file, giving the attacker a server‑side file‑read capability that was originally mitigated in a prior release.

Affected Systems

The vulnerability affects the open‑source Langroid framework, specifically versions earlier than 0.65.1, when the SQLChatAgent runs with its default setting allow_dangerous_operations=False. In these configurations, any user that can trigger the query generation interface and whose database role possesses the right to run pg_read_file can read arbitrary files on the database host. The exploitation also depends on the database server accepting the injected query without additional parameterization.

Risk and Exploitability

The CVSS score of 9.3 classifies this issue as critical, while the EPSS score of less than 1 % indicates a low but non‑zero likelihood of real‑world exploitation. The vulnerability is not listed in CISA’s KEV catalog. An attacker can exploit it by submitting a designed query via Langroid’s interface; the bypass relies on improper function‑name validation (CWE‑89) and affords a path‑influenced file read (CWE‑22) under privileged database context.

Generated by OpenCVE AI on August 1, 2026 at 13:31 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update Langroid to version 0.65.1 or newer, which removes the bypassed regex and blocks pg_read_file calls.
  • Grant the Langroid database role only the minimum privileges required for application operation, ensuring it cannot execute server‑side functions like pg_read_file.
  • Employ parameterized queries or a strict allowlist in SQLChatAgent to eliminate the dangerous function blocklist bypass and enforce input validation.

Generated by OpenCVE AI on August 1, 2026 at 13:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-6xc5-4r68-67fc Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls
History

Fri, 10 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 10 Jul 2026 01:45:00 +0000

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

Fri, 10 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
Description Langroid is a framework for building large-language-model-powered applications. Prior to version 0.65.1, the `SQLChatAgent` SQL-injection mitigation, with default `allow_dangerous_operations=False`, combines a raw-text regex blocklist (`_DANGEROUS_SQL_PATTERNS`) with a `sqlglot` SELECT-only statement allowlist. The blocklist entries that target callable functions require the function name to be immediately followed by `\s*\(`. PostgreSQL accepts the same call with the name separated from `(` by a quoted identifier, an inline comment, or schema qualification. These forms evade the regex, still parse as `SELECT`, and execute the same PostgreSQL function. This restores the `pg_read_file` server-side file-read primitive that the prior CVE-2026-25879 / GHSA-pmch-g965-grmr fix was meant to block: the parent advisory fixed a missing `pg_read_file` blocklist entry, while this report shows that the added regex is bypassable. Version 0.65.1 fixes the issue.
Title Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls
Weaknesses CWE-22
CWE-89
References
Metrics cvssV4_0

{'score': 9.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Langroid Langroid
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-10T15:27:12.550Z

Reserved: 2026-06-15T23:12:41.966Z

Link: CVE-2026-54760

cve-icon Vulnrichment

Updated: 2026-07-10T15:26:52.026Z

cve-icon NVD

Status : Deferred

Published: 2026-07-10T00:16:33.477

Modified: 2026-07-10T16:16:33.063

Link: CVE-2026-54760

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-01T13:45:03Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-89

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