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

Source: https://junglewise.ai/threats/cve-2026-50180-langroid-sqlchatagent-arbitrary-file-read-via-sql-blocklist  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-10. Updated: 2026-07-10  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/langroid). Vendors: [PyPI](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/langroid/langroid/commit/00b7dd7b79c5d03c94be284cf3459d98195ebfba](https://github.com/langroid/langroid/commit/00b7dd7b79c5d03c94be284cf3459d98195ebfba)
- [https://github.com/langroid/langroid/security/advisories/GHSA-pmch-g965-grmr](https://github.com/langroid/langroid/security/advisories/GHSA-pmch-g965-grmr)

## Related threats

- [Langroid prompt injection in Neo4jChatAgent and ArangoChatAgent](https://junglewise.ai/threats/cve-2026-55615-langroid-prompt-injection-in-neo4jchatagent-and-arangochatagent)
- [Langroid unauthorized tool invocation via raw JSON payloads](https://junglewise.ai/threats/cve-2026-54771-langroid-unauthorized-tool-invocation-via-raw-json-payloads)
- [Langroid sandbox escape and RCE in TableChatAgent and VectorStore](https://junglewise.ai/threats/cve-2026-54769-langroid-sandbox-escape-and-rce-in-tablechatagent-and-vectorstore)
- [Langroid SQLChatAgent regex bypass in SQL injection mitigation](https://junglewise.ai/threats/cve-2026-54760-langroid-sqlchatagent-regex-bypass-in-sql-injection-mitigation)
- [Langroid path traversal in ReadFileTool and WriteFileTool](https://junglewise.ai/threats/cve-2026-50181-langroid-path-traversal-in-readfiletool-and-writefiletool)
