PyPI: langroid
CVE-2026-54760
Safety vulnerability ID: SFTY-20260706-47832
Affected versions of the SQLChatAgent package are vulnerable to Improper Input Validation due to bypassable regex-based dangerous-function blocklists. The `_validate_query` method relies on a raw-text regex to detect dangerous PostgreSQL function calls, which can be evaded by using quoted identifiers, inline comments, or schema-qualified names that still parse as valid `SELECT` statements. An attacker capable of influencing LLM-generated SQL can exploit this vulnerability to execute obfuscated queries that invoke `pg_read_file`, potentially reading files accessible to the PostgreSQL server process under certain role permissions.
Overview
Langroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file calls
Advisory
langroid – Path Traversal
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
