Critical (AgentArmorHQ estimate)Code execution

Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls

Product
langroid
CVE
CVE-2026-54760
Affected
pip/langroid <= 0.65.0
Fixed in
0.65.1

Last verified against sources: October 26, 2026

Am I affected?

langroid: affected pip/langroid <= 0.65.0. Fixed in 0.65.1.

  • Check your version: run pip show langroid. Versions <= 0.65.0 of langroid are affected. [1]

What to do now

  1. Upgrade to the fixed version: run pip install --upgrade "langroid>=0.65.1" (first patched version 0.65.1). [1]
  2. Run SQLChatAgent with a least-privilege database role that lacks pg_read_server_files. [1]

General practice, not from the source: if the affected software could read tokens or credentials, rotate them after upgrading; pin versions and review changes before updating tools your agents run.

Discuss this incident

What happened

  • 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. [1]
  • PostgreSQL accepts the same call with the name separated from ( by a quoted identifier, an inline comment, or schema qualification. [1]
  • These forms evade the regex, still parse as SELECT, and execute the same PostgreSQL function. [1]
  • The dangerous-call check is raw text, not normalized AST function-name matching. [1]

Impact

  • An attacker who can influence LLM-generated SQL can coerce the agent into emitting one of the obfuscated queries and read files accessible to the PostgreSQL server process through pg_read_file. [1]
  • Severity: High by parity with the published parent advisory; not Critical. [1]
  • CWE-184 leading to server-side file read. [1]

What was done

  • Packages: pip/langroid affected <= 0.65.0 patched 0.65.1. [1]
  • Do not rely on raw-text regex matching for dangerous-call detection. [1]
  • After the existing sqlglot parse, walk the AST and reject any function invocation whose normalized, unquoted, schema-stripped, case-folded name is in a dangerous set such as pg_read_file, pg_read_binary_file, pg_ls_dir, pg_stat_file, lo_import, lo_export, load_file, or load_extension. [1]

Sources

  1. GHSA-6xc5-4r68-67fc — GitHub Advisory Database

Every statement above was checked against these sources before publishing. Spotted an error? Tell us and we will correct it with a dated note.

Share advisory brief with your team

Copy a plain-text summary for Slack, GitHub issues, or team security channels.

Brief
[CVE-2026-54760] Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls
Product: langroid | Affected: pip/langroid <= 0.65.0 | Fixed in: 0.65.1
Summary: 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.
Source & remediation on AgentArmorHQ: https://agentarmorhq.com/incidents/2026/07/cve-2026-54760-langroid
Was this page useful?

Corrections

Report an error or request a correction. We review requests within 5 business days and add a dated correction note.

10 to 2,000 characters. A link to a source helps. Stored as plain text.

Discussions for CVE-2026-54760

Ask questions or share configuration tips. Governed by our Community Rules & Terms.

No posts match this filter yet.

Be the first to ask a question or share a working tip.

Check before you install

Paste a package name or a GitHub link and get a clear answer in seconds: Block, Review or No known issues. No account needed.

Check a package

Questions? Contact us