提交 #880544: zhongyu09 OpenChatBI 1.0 SQL Injection信息

标题zhongyu09 OpenChatBI 1.0 SQL Injection
描述An incomplete SQL safety validation in OpenChatBI allows arbitrary file read and potential remote code execution on PostgreSQL backends. The function _validate_sql_safety() in openchatbi/text2sql/generate_sql.py blocks DDL/DML operations (DROP, INSERT, UPDATE, DELETE) but fails to block dangerous PostgreSQL functions that enable filesystem access and OS command execution. Affected File: openchatbi/text2sql/generate_sql.py Affected Function: _validate_sql_safety() (line 59) Missing blocked patterns: - pg_read_file() — arbitrary file read - COPY ... TO PROGRAM — remote code execution - dblink() / dblink_exec() — SSRF and remote query execution - lo_import() / lo_export() — large object file access - load_extension() — SQLite arbitrary code execution PoC Steps: 1. Deploy OpenChatBI connected to a PostgreSQL database 2. Send a natural language query that causes the LLM to generate: SELECT pg_read_file('/etc/passwd') 3. The query passes _validate_sql_safety() (returns True) and executes against the database 4. Server filesystem contents are returned to the attacker Tested: SELECT pg_read_file('/etc/passwd') passes validation and returns file contents when executed against PostgreSQL 18. Impact: Any user who can send natural language queries to an OpenChatBI instance can read arbitrary files from the database server. With COPY TO PROGRAM, full remote code execution is achievable. Reference: https://github.com/zhongyu09/openchatbi
来源⚠️ https://github.com/zhongyu09/openchatbi
用户
 Yogender (UID 99560)
提交2026-07-05 12時42分 (2 月前)
管理2026-09-01 07時45分 (2 months later)
状态已接受
VulDB条目397552 [zhongyu09 OpenChatBI 直到 0.3.0 generate_sql.py _validate_sql_safety SQL注入]
积分20

Do you know our Splunk app?

Download it now for free!