# CVE-2026-54760: Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls

- Severity: Critical 9.3 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.56%, higher than 47% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-07-06T20:39:02.000Z
- Modified: 2026-07-13T16:43:04.490Z
- Also known as: GHSA-6xc5-4r68-67fc, PYSEC-2026-2577
- Weaknesses: CWE-22, CWE-89
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: GitHub_M

## Description

Langroid is a framework for building large-language-model-powered applications. Prior to version 0.65.1, the `SQLChatAgent` SQL-injection mitigation, with default `allow_dangerous_operations=False`, combines a raw-text regex blocklist (`_DANGEROUS_SQL_PATTERNS`) with a `sqlglot` SELECT-only statement allowlist. The blocklist entries that target callable functions require the function name to be immediately followed by `\s*\(`. PostgreSQL accepts the same call with the name separated from `(` by a quoted identifier, an inline comment, or schema qualification. These forms evade the regex, still parse as `SELECT`, and execute the same PostgreSQL function. This restores the `pg_read_file` server-side file-read primitive that the prior CVE-2026-25879 / GHSA-pmch-g965-grmr fix was meant to block: the parent advisory fixed a missing `pg_read_file` blocklist entry, while this report shows that the added regex is bypassable. Version 0.65.1 fixes the issue.

(As written by CVE List.)

## Affected

- langroid langroid: < 0.65.1
- langroid (PyPI): before 0.65.1

## Every score

- GitHub_M: CVSS:4.0 9.3 Critical `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- GitHub: CVSS:4.0 Critical `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- PyPA Advisory Database: CVSS:4.0 `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`

## References

- <https://github.com/langroid/langroid/security/advisories/GHSA-6xc5-4r68-67fc> (exploit, web)
- <https://github.com/langroid/langroid> (package)
- <https://pypi.org/project/langroid> (package)
- <https://github.com/advisories/GHSA-6xc5-4r68-67fc> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-54760> (advisory)

## Sources

- CVE List: [CVE-2026-54760](https://www.cve.org/CVERecord?id=CVE-2026-54760), CVE Terms of Use, modified 2026-07-10
- GitHub Advisory Database: [GHSA-6xc5-4r68-67fc](https://github.com/advisories/GHSA-6xc5-4r68-67fc), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2026-54760](https://nvd.nist.gov/vuln/detail/CVE-2026-54760), Public domain, modified 2026-07-10
- PyPA Advisory Database: [PYSEC-2026-2577](https://osv.dev/vulnerability/PYSEC-2026-2577), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-54760 · Whole record: https://cve.day/CVE-2026-54760.json · Rebuilt by cve.day 2026-11-25T22:59:27.584Z
