Skip to content
HighVulnerabilityLLM-specific

GHSA-pmch-g965-grmr: Langroid: SQLChatAgent _validate_query blocklist misses pg_read_file family enabling arbitrary file read

Published
Record updated
View JSON
Affected
  • langroid <= 0.63.0
Fixed in
0.64.0
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.7%

Summary

The SQLChatAgent in langroid, versions up to and including 0.63.0, uses a regex blocklist (_DANGEROUS_SQL_PATTERNS in sql_chat_agent.py) that omits PostgreSQL's pg_read_file, pg_stat_file, pg_ls_logdir, pg_ls_waldir and related functions, plus SQL Server OPENDATASOURCE and SQLite ATTACH without the DATABASE keyword. Because these payloads are ordinary SELECT statements, they pass the statement-type allowlist and reach the live engine, letting an attacker who can shape the LLM's generated SQL read arbitrary files from the PostgreSQL host, even under the default configuration.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.