{"id":"CVE-2026-50180","published":"2026-07-09T23:42:52Z","modified":"2026-07-10T20:59:17Z","title":"Langroid: SQLChatAgent _validate_query blocklist misses pg_read_file family enabling arbitrary file read","vendor":"langroid","product":"langroid","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00686,"percentile":0.53587,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://github.com/langroid/langroid/security/advisories/GHSA-pmch-g965-grmr","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/langroid/langroid/commit/00b7dd7b79c5d03c94be284cf3459d98195ebfba","tags":["x_refsource_MISC"]}],"priority":{"score":16.8,"factors":[{"name":"EPSS percentile","points":10.72},{"name":"CVSS severity","points":6.09}]},"vendorSlug":"langroid","affectedVersions":[{"vendor":"langroid","product":"langroid","versions":["< 0.64.0"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-07-10T20:53:14.249515Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"langroid","vulnerableRanges":["<0.64.0"],"patched":["0.64.0"],"from":["GHSA-pmch-g965-grmr","PYSEC-2026-2580"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-42762","exploited":false,"provenance":"source"}}