Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

GHSA-pmch-g965-grmr: Langroid: SQLChatAgent _validate_query blocklist misses pg_read_file family enabling arbitrary file read

0
High
Published: 07/02/2026 (07/02/2026, 17:42:09 UTC)
Source: GCVE Database
Product: langroid

Description

Langroid versions up to 0.63.0 contain a vulnerability in the SQLChatAgent component where the _validate_query method's regex blocklist fails to block certain PostgreSQL functions that can read arbitrary files from the host filesystem. This allows an attacker who can influence the LLM-generated SQL queries to perform unauthorized file reads via SELECT statements, bypassing the agent's default restrictions. No PostgreSQL credentials are required, as the agent holds them. The vulnerability also affects some SQLite and SQL Server functions due to incomplete blocklisting. No official patch or fix is currently documented.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

PyPIghsa
langroid
Affected versions
<0.64.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/02/2026, 23:17:30 UTC

Technical Analysis

The SQLChatAgent in langroid uses a regex-based blocklist (_DANGEROUS_SQL_PATTERNS) to prevent dangerous SQL operations by blocking specific function names. However, this blocklist omits several PostgreSQL filesystem-disclosure functions such as pg_read_file(), pg_stat_file(), pg_ls_logdir(), pg_ls_waldir(), and pg_current_logfile(), which return file contents or directory listings. These functions are callable via SELECT statements, which pass the agent's statement-type allowlist and evade the regex blocklist, reaching the SQLAlchemy execution engine. Consequently, an attacker able to influence the LLM's generated SQL query string can read arbitrary files on the PostgreSQL host without needing database credentials. Similar gaps exist for SQLite's ATTACH without the DATABASE keyword and SQL Server's OPENDATASOURCE. The affected versions are langroid <= 0.63.0. No patch or official fix is currently available.

Potential Impact

An attacker who can influence the SQL queries generated by the LLM in langroid's SQLChatAgent can read arbitrary files from the PostgreSQL host filesystem. This can lead to unauthorized disclosure of sensitive data stored on the database server. The attack requires no direct database credentials from the attacker, as the agent holds them. The vulnerability bypasses existing query type restrictions and regex-based blocklists, making it a high-severity information disclosure risk.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, restrict or sanitize inputs that influence the LLM-generated SQL queries to prevent injection of dangerous function calls. Consider disabling or limiting the use of SQLChatAgent features that allow arbitrary query execution, or deploy additional query validation layers that explicitly block the missing PostgreSQL functions (e.g., pg_read_file, pg_stat_file, pg_ls_logdir, pg_ls_waldir, pg_current_logfile).

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-pmch-g965-grmr
Osv Schema Version
1.4.0
Aliases
["CVE-2026-50180"]
Ecosystems
["PyPI"]
Database Specific Severity
HIGH
Cvss Version
4.0

Threat ID: 6a46ecc427e9c7971943d784

Added to database: 07/02/2026, 22:57:08 UTC

Last enriched: 07/02/2026, 23:17:30 UTC

Last updated: 07/02/2026, 23:17:30 UTC

Views: 2

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses