{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-50180","id":"CVE-2026-50180","title":"Langroid: SQLChatAgent _validate_query blocklist misses pg_read_file family enabling arbitrary file read","description":"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()`, ","descriptionLong":"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.","published":"2026-07-09T23:42:52.853Z","updated":"2026-10-28T02:30:48.591714215Z","reserved":"2026-06-03T22:05:13.644Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"version":"4.0","score":8.7,"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","rating":"high","source":"GitHub_M"},"metrics":[{"version":"4.0","score":8.7,"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","rating":"high","source":"GitHub_M"},{"version":"4.0","score":8.7,"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/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","rating":"high","source":"github.com"},{"version":"4.0","score":null,"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","rating":"unrated","source":"OSV"},{"version":"4.0","score":null,"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","rating":"high","source":"GitHub"}],"rating":"high","products":["langroid"],"affectedProducts":[{"vendor":"langroid","product":"langroid","defaultStatus":null,"versions":[{"version":"< 0.64.0","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"langroid","purl":"pkg:pypi/langroid","ranges":["<0.64.0"],"fixed":["0.64.0"],"advisory":"GHSA-pmch-g965-grmr"}],"cwes":["CWE-22","CWE-89"],"aliases":["GHSA-pmch-g965-grmr","PYSEC-2026-2580"],"references":[{"url":"https://github.com/langroid/langroid/security/advisories/GHSA-pmch-g965-grmr","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/langroid/langroid/commit/00b7dd7b79c5d03c94be284cf3459d98195ebfba","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/50xxx/CVE-2026-50180.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50180","tags":["advisory"]},{"url":"https://github.com/langroid/langroid","tags":["package"]},{"url":"https://pypi.org/project/langroid","tags":["package"]},{"url":"https://github.com/advisories/GHSA-pmch-g965-grmr","tags":["advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial"},"epss":0.00686,"epssPercentile":0.53445,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-50180","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50180","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-50180","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-pmch-g965-grmr","ok":true,"note":"GHSA-pmch-g965-grmr"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-50180","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}