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.

Created at: Jul 10, 2026Updated at: Jul 10, 2026

Overview

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

Advisory

langroid – Path Traversal

Affected Package

Affecting langroid package, versions<= 0.65.0

Also affects

---

How to Fix

Upgradelangroidto0.65.1or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

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