CVE-2026-50180: Langroid SQLChatAgent arbitrary file read via SQL blocklist bypass

CVE-2026-50180 · Severity: high · CVSS 4 · Published 2026-07-10

Langroid is a framework used to build applications powered by Large Language Models (LLMs). A security flaw in its SQL database agent allows an attacker to trick the AI into running restricted database commands. This can lead to the unauthorized reading of sensitive files from the server hosting the database, potentially exposing configuration files, logs, or other private data.

Technologies: langroid (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-50180 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-50180 being exploited in the wild.
How severe is CVE-2026-50180?
High severity, with a CVSS score of 4, published 10 July 2026.
Which products and versions are affected?
langroid (PyPI) <= 0.63.0, ECOSYSTEM:introduced=0,fixed=0.64.0.
Is there a fix for CVE-2026-50180?
Yes. langroid (PyPI): upgrade to 0.64.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-50180 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-50180?
Check whether you run langroid (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • langroid (PyPI): upgrade to 0.64.0 or later
    pip install "langroid>=0.64.0"

Technical details

The `SQLChatAgent` in Langroid uses a regex-based blocklist (`_DANGEROUS_SQL_PATTERNS`) within its `_validate_query` method to prevent dangerous SQL operations. This blocklist fails to include several PostgreSQL file-disclosure functions such as `pg_read_file()`, `pg_stat_file()`, and `pg_ls_logdir()`, as well as SQL Server's `OPENDATASOURCE` and certain SQLite `ATTACH` syntax variations. Because these functions are executed within standard `SELECT` statements, they bypass the default `allowed_statement_types=['SELECT']` restriction. An attacker can exploit this via prompt injection or by influencing the LLM's input to generate malicious SQL queries that reach the SQLAlchemy engine. The issue is addressed in version 0.64.0 by expanding the regex patterns to cover these function families.

Affected products

  • langroid langroid < 0.64.0

Identifiers

  • CVE-2026-50180
  • GHSA-pmch-g965-grmr
  • PYSEC-2026-2580

Timeline

  • 2026-05-28: advisory: GitHub Security Advisory published
  • 2026-07-10: disclosed: NVD publication date

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.