Path TraversalWeakness · CWE-22

CVE-2026-50180

HIGH · 8.7 CVSS v4.0 Published 2026-07-10
Patch available
A vendor patch is available. No clean upgrade release — apply the published patch.
See remediation →
96/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click Patch available 6 weeks old

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Langroid is a framework for building large-language-model-powered applications. Prior to version 0.64.0, `SQLChatAgent` in `langroid` ships a `_validate_query` defense-in-depth layer whose `_DANGEROUS_SQL_PATTERNS` regex blocklist enumerates dangerous SQL primitives by specific function name. The list misses the canonical PostgreSQL filesystem-disclosure family `pg_read_file()`, `pg_stat_file()`, `pg_ls_logdir()`, `pg_ls_waldir()`, `pg_current_logfile()` (and similar `SELECT`-shaped functions in the same family). It also leaves SQL Server `OPENDATASOURCE` and SQLite `ATTACH '<file>' AS x` (DATABASE keyword omitted) unblocked. An attacker able to shape the LLM's generated SQL (directly via prompt input or transitively via prompt-injection in data the LLM ingests) can read arbitrary files from the PostgreSQL host through ordinary `SELECT` queries, even with the agent's strict default configuration (`allow_dangerous_operations=False`, `allowed_statement_types=['SELECT']`). The payloads survive the statement-type allowlist (each is a `SELECT`) and pass through the regex blocklist (none of the function names match), then reach the live SQLAlchemy engine via `SQLChatAgent.run_query`. Version 0.64.0 contains a patch for the issue.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Langroid's SQLChatAgent has an incomplete regex blocklist (_DANGEROUS_SQL_PATTERNS) that fails to block dangerous PostgreSQL filesystem functions (pg_read_file, pg_stat_file, pg_ls_logdir, pg_ls_waldir, pg_current_logfile), SQL Server OPENDATASOURCE, and SQLite ATTACH. These SELECT-based payloads bypass both the allow_dangerous_operations setting and the statement-type allowlist, enabling arbitrary file reads from the database host.

MitigationUpgrade to langroid version 0.64.0 or later, which contains the patch adding the missing patterns to the blocklist.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
Authentication
X
User interaction
None
Scope
X

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed Langroid version
    Run `pip show langroid` or `pip list | grep langroid` to display the installed package version
    Affected if Version is below 0.64.0 (the patch that added missing patterns to the blocklist)
  2. Verify SQLChatAgent is in use
    Inspect your codebase for imports and instantiation of `SQLChatAgent` from langroid, or check runtime configuration for agent type
    Affected if SQLChatAgent class is being used for database interactions
  3. Inspect the _DANGEROUS_SQL_PATTERNS blocklist
    Locate the langroid source file containing `_DANGEROUS_SQL_PATTERNS` (typically in agent/sql/sql_chat_agent.py or similar) and examine the regex patterns defined there
    Affected if The blocklist does NOT contain: pg_read_file, pg_stat_file, pg_ls_logdir, pg_ls_waldir, pg_current_logfile (PostgreSQL), OPENDATASOURCE (SQL Server), or ATTACH (SQLite)
  4. Check allow_dangerous_operations setting
    Search your configuration or code for `allow_dangerous_operations` setting passed to SQLChatAgent
    Affected if Setting is enabled (True) or not explicitly blocking SELECT-based file-read operations
  5. Confirm database type in use
    Review your database connection configuration to identify if PostgreSQL, SQL Server, or SQLite is being used with SQLChatAgent
    Affected if Connected database is PostgreSQL, SQL Server, or SQLite - these are the affected database backends

You are affected if you use SQLChatAgent with Langroid version below 0.64.0 and connect to PostgreSQL, SQL Server, or SQLite databases, particularly with allow_dangerous_operations enabled.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Patch available Apply the vendor patch
Vendor patch github.com →
Interim mitigation

Upgrade to langroid version 0.64.0 or later, which contains the patch adding the missing patterns to the blocklist.

Recommended fix High confidence

0.64.0

  1. Upgrade langroid to version 0.64.0 or later using your package manager (e.g., pip install langroid>=0.64.0 or pip install --upgrade langroid)
  2. Verify the upgrade was successful by checking the installed version (e.g., pip show langroid | grep Version)

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation1.0 h
  • Implementation1.0 h
  • Testing2.0 h
  • Review / QA1.0 h
5.0 hours of engineering $860
Get the patch applied

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,376.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-50180 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-50180 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data