GHSA-qqf5-x7mj-v43p: budibase SQL Injection Vulnerability
HIGHGHSA-qqf5-x7mj-v43p is a HIGH (CVSS 8.4) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting budibase libraries in the npm ecosystem. The issue involves database connector sql injections in postgresql, ms sql, and mysql. Remediation is available by upgrading affected packages to version 3.39.19.
GHSA-qqf5-x7mj-v43p at a Glance
Security Impact
CVSS: 8.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H).
How to Fix GHSA-qqf5-x7mj-v43p
To remediate this vulnerability, upgrade all affected budibase dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install budibase@3.39.19
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls budibase
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-qqf5-x7mj-v43p, inspect your project dependencies using npm:
npm ls budibase
Analyze the terminal output to locate any version of budibase in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.39.19), your application is affected.
Note: The npm ls budibase command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In budibase, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-qqf5-x7mj-v43p Affected budibase Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
budibase
|
npm |
< 3.39.19
|
3.39.19
|
References
Frequently Asked Questions
What is GHSA-qqf5-x7mj-v43p?
Which budibase versions are affected?
What version fixes GHSA-qqf5-x7mj-v43p?
Is budibase affected?
What is the CVSS score of GHSA-qqf5-x7mj-v43p?
What CWE is associated with GHSA-qqf5-x7mj-v43p?
How can I check npm dependencies for GHSA-qqf5-x7mj-v43p?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qqf5-x7mj-v43p",
"modified" : "2026-06-18T17:24:47Z",
"published" : "2026-06-18T17:24:47Z",
"aliases" : [ ],
"summary" : "budibase: Database Connector SQL Injections in PostgreSQL, MS SQL, and MySQL",
"details" : "### Summary\nThis 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`).\n\n### Details\n\n### Vulnerability Type & Title\n**PostgreSQL `SET search_path` SQL Injection**\n\n### Description & Root Cause\nThe `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.\n\n**Vulnerable Code:**\n**File:** `packages/server/src/integrations/postgres.ts`, lines 355–358\n\n```typescript\nconst search_path = this.config.schema\n .split(\",\")\n .map(item => `\"${item.trim()}\"`) // NO escaping of embedded \"\nawait this.client.query(`SET search_path TO ${search_path.join(\",\")};`)\n```\n\n`node-postgres` sends this via the **simple query protocol**, which supports multi-statement execution with semicolons.\n\n### Step-by-Step Reproduction\n1. Edit a PostgreSQL datasource configuration.\n2. Set the schema field to:\n `public\"; CREATE TABLE pwned AS SELECT usename, passwd FROM pg_shadow; --`\n3. Save or trigger a connection test.\n4. The query executes as:\n `SET search_path TO \"public\"; CREATE TABLE pwned AS SELECT usename, passwd FROM pg_shadow; --;`\n5. PostgreSQL executes both statements.\n\n### Impact\n- Full database compromise. The attacker can read `pg_shadow` hashes, call `pg_read_file()`, or execute any DDL/DML.\n\n---\n\n### Vulnerability Type & Title\n**Microsoft SQL Server Schema Introspection SQL Injection**\n\n### Description & Root Cause\nThree methods used during schema introspection (`buildSchema`) interpolate user-controlled values directly into SQL strings using single-quote delimiters with no escaping.\n\n**Vulnerable Code:**\n**File:** `packages/server/src/integrations/microsoftSqlServer.ts`, lines 388–414\n\n```typescript\ngetDefinitionSQL(tableName: string, schemaName: string) {\n return `select * from INFORMATION_SCHEMA.COLUMNS\n where TABLE_NAME='${tableName}' AND TABLE_SCHEMA='${schemaName}'`\n}\n```\n\n`schemaName` comes directly from `this.config.schema` (user config).\n\n### Step-by-Step Reproduction\n1. Edit an MS SQL Server datasource configuration.\n2. Set the schema field to: `dbo'; EXEC xp_cmdshell('whoami'); --`\n3. Trigger schema introspection (fetch tables).\n4. The OS command executes on the SQL server if `xp_cmdshell` is enabled.\n\n### Impact\n- Arbitrary SQL execution, potentially leading to OS command execution via `xp_cmdshell`.\n\n---\n\n### Vulnerability Type & Title\n**MySQL `multipleStatements: true` + `DESCRIBE` Backtick Injection**\n\n### Description & Root Cause\nThe MySQL integration enables `multipleStatements: true`, allowing semicolon-separated multi-statement execution. When introspecting tables, table names are interpolated into a `DESCRIBE` query wrapped in backticks, but the backticks are not escaped.\n\n**Vulnerable Code:**\n**File:** `packages/server/src/integrations/mysql.ts`, lines 172, 305\n\n```typescript\nthis.config = { ...config, multipleStatements: true, ... } // line 172\n...\n{ sql: `DESCRIBE \\`${tableName}\\`;` } // line 305 — backtick NOT escaped\n```\n\n### Step-by-Step Reproduction\n1. An attacker (or malicious database user) creates a table named ``foo`; DROP TABLE users; --``.\n2. In Budibase, an admin triggers schema introspection for the database.\n3. Budibase reads the malicious table name from `INFORMATION_SCHEMA.TABLES` and inserts it into the `DESCRIBE` query.\n4. The backtick breaks out, and the secondary `DROP TABLE` payload executes.\n\n### Impact\n- Arbitrary SQL execution triggered during schema discovery. Requires prior database catalog manipulation.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "budibase"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.39.19"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Budibase/budibase/security/advisories/GHSA-qqf5-x7mj-v43p"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Budibase/budibase"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-18T17:24:47Z",
"nvd_published_at" : null
}
}