Description:
A Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI) vulnerability exists in vanna-ai/vanna when using DuckDB as the database backend. An unauthenticated attacker can inject arbitrary SQL containing DuckDB's built-in file/HTTP functions (read_csv, read_csv_auto, read_text, read_blob) via the /api/v0/update_sql endpoint, and then trigger execution via /api/v0/run_sql. This causes the server to make HTTP requests to attacker-controlled or internal URLs (SSRF), or read arbitrary local files (LFI) and return the contents to the attacker.
The vulnerability requires no authentication (default NoAuth), no special privileges, and no user interaction. All malicious payloads are valid SELECT statements that bypass Vanna's is_sql_valid() check.