Gửi #797644: coze-dev coze-studio <= 0.5.1 SQL Injection (CWE-89) / Improper Input Validation (CWE-20)thông tin

tiêu đềcoze-dev coze-studio <= 0.5.1 SQL Injection (CWE-89) / Improper Input Validation (CWE-20)
Mô tả# Technical Details A critical SQL validation bypass vulnerability was successfully identified in the `ExecuteSQL` operation mapped to the Coze Agent `databaseTool`. By chaining two specific syntax evasion techniques—utilizing MySQL backticks to sidestep uppercase substring verification and leveraging parentheses to deliberately break Regex extraction grouping—an unauthenticated or underprivileged Prompt Injector can execute uncontrolled SQL queries. # Vulnerable Code File: backend/domain/memory/database/service/database_impl.go Method: validateCustomSQL & validateParsedSQL Why: 1. `validateCustomSQL` strictly attempts to block explicit access to system resources by up-casing the SQL query and inspecting for restricted tokens (e.g., `MYSQL.`). Supplying MySQL identifiers within backticks (`mysql`.`user`) inherently translates to `MYSQL`.`USER` under `ToUpper()`, successfully evading the `strings.Contains` check. 2. `validateParsedSQL` uses a flawed Regular Expression (`regexp.MustCompile`) that forcefully extracts the exact target table name to be verified against a strict whitelist. The expression blindly assumes the SQL table syntax follows `[SPACE] + [OPTIONAL BACKTICK] + [alphanumeric string]`. By enclosing the schema target in a nested extraction boundary `FROM (`, the regex silently fails to capture arrays, allowing the payload through. # Reproduction 1. Ensure the target host process operates an Agent Endpoint (Coze Studio). 2. Through the Chat API (`/v3/chat`), utilize an Agent that has access to the database tool. 3. Provide a natural language prompt enclosing the malicious SQL syntax satisfying both constraints: `SELECT (SELECT authentication_string FROM (\`mysql\`.\`user\`) LIMIT 1) AS hacked_hash FROM table_123`. 4. The system queries the internal relational database as root, bypassing all application-layer restrictions. # Impact - Severe SQL Injection and Unauthorized System Database Access. - Allows uncontrolled extraction of critical internal database architecture and tenant isolation breaks. - Extremely high exploitability as LLM prompts provide a near zero-barrier vector for triggering these operations simply via standard Chat UI/API access.
Nguồn⚠️ https://gist.github.com/YLChen-007/272fe62967b42259ed767d109615030a
Người dùng
 Eric-b (UID 96354)
Đệ trình06/04/2026 05:54 (cách đây 21 ngày)
Kiểm duyệt25/04/2026 15:56 (19 days later)
Trạng tháiđược chấp nhận
Mục VulDB359602 [ByteDance coze-studio đến 0.5.1 databaseTool database_impl.go ExecuteSQL Tiêm SQL]
điểm20

Interested in the pricing of exploits?

See the underground prices here!