GHSA-qqf5-x7mj-v43p
### Summary This advisory covers three distinct SQL Injection vulnerabilities within Budibase's database connectors (PostgreSQL, Microsoft SQL Server, and MySQL). Because user-controlled schema and table configurations are interpolated directly into raw SQL queries without proper escaping or parameterization during database introspection, an authenticated administrator can break out of string delimiters. This allows for arbitrary DDL/DML execution, database compromise, and potential underlying OS command execution (e.g., via MS SQL `xp_cmdshell`). ### Details ### Vulnerability Type & Title **PostgreSQL `SET search_path` SQL Injection** ### Description & Root Cause The `schema` datasource config field is interpolated directly into a raw SQL statement without proper escaping. Double quotes inside the schema name are not escaped, allowing an attacker to break out of the string literal and inject arbitrary SQL. **Vulnerable Code:** **File:** `packages/server/src/integrations/postgres.ts`, lines 355–358 ```typescript const search_path = this.config.schema .split(",") .map(item => `"${item.trim()}"`) // NO escaping of embedded " await this.client.query(`SET search_path TO ${search_path.join(",")};`) ``` `node-postgres` sends this via the **simple query protocol**, which supports multi-statement execution with semicolons. ### Step-by-Step Reproduction 1. Edit a PostgreSQL datasource configuration. 2. Set the schema field to: `public"; CREATE TABLE pwned AS SELECT usename, passwd FROM pg_shadow; --` 3. Save or trigger a connection test. 4. The query executes as: `SET search_path TO "public"; CREATE TABLE pwned AS SELECT usename, passwd FROM pg_shadow; --;` 5. PostgreSQL executes both statements. ### Impact - Full database compromise. The attacker can read `pg_shadow` hashes, call `pg_read_file()`, or execute any DDL/DML. --- ### Vulnerability Type & Title **Microsoft SQL Server Schema Introspection SQL Injection** ### Description & Root C
Properties
- ghsa_id
- GHSA-qqf5-x7mj-v43p
- severity
- high
- summary
- budibase: Database Connector SQL Injections in PostgreSQL, MS SQL, and MySQL
- cvss_score
- 8.4
- cve_id
- GHSA-qqf5-x7mj-v43p
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H
- is_ghsa_only
- true
- ghsa_published
- 2026-06-18T17:24:47Z
- source_url
- https://github.com/advisories/GHSA-qqf5-x7mj-v43p
- ghsa_updated
- 2026-06-18T17:24:49Z
Related Entities (4)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph