Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm

GHSA-qqf5-x7mj-v43p

HIGH

GHSA-qqf5-x7mj-v43p is a high-severity (CVSS 8.4) vulnerability in budibase. O3 Security confirms whether GHSA-qqf5-x7mj-v43p is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

budibase: Database Connector SQL Injections in PostgreSQL, MS SQL, and MySQL

Published
Jun 18, 2026
Updated
Jun 18, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed

Blast Radius

1 pkg affected

Weekly download volume for affected packages — a proxy for how broadly this vulnerability is deployed.

budibasenpm
50downloads / week

Description

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

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 Cause

Three methods used during schema introspection (buildSchema) interpolate user-controlled values directly into SQL strings using single-quote delimiters with no escaping.

Vulnerable Code: File: packages/server/src/integrations/microsoftSqlServer.ts, lines 388–414

getDefinitionSQL(tableName: string, schemaName: string) {
  return `select * from INFORMATION_SCHEMA.COLUMNS
          where TABLE_NAME='${tableName}' AND TABLE_SCHEMA='${schemaName}'`
}

schemaName comes directly from this.config.schema (user config).

Step-by-Step Reproduction

  1. Edit an MS SQL Server datasource configuration.
  2. Set the schema field to: dbo'; EXEC xp_cmdshell('whoami'); --
  3. Trigger schema introspection (fetch tables).
  4. The OS command executes on the SQL server if xp_cmdshell is enabled.

Impact

  • Arbitrary SQL execution, potentially leading to OS command execution via xp_cmdshell.

Vulnerability Type & Title

MySQL multipleStatements: true + DESCRIBE Backtick Injection

Description & Root Cause

The 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.

Vulnerable Code: File: packages/server/src/integrations/mysql.ts, lines 172, 305

this.config = { ...config, multipleStatements: true, ... }  // line 172
...
{ sql: `DESCRIBE \`${tableName}\`;` }  // line 305 — backtick NOT escaped

Step-by-Step Reproduction

  1. An attacker (or malicious database user) creates a table named foo`; DROP TABLE users; --.
  2. In Budibase, an admin triggers schema introspection for the database.
  3. Budibase reads the malicious table name from INFORMATION_SCHEMA.TABLES and inserts it into the DESCRIBE query.
  4. The backtick breaks out, and the secondary DROP TABLE payload executes.

Impact

  • Arbitrary SQL execution triggered during schema discovery. Requires prior database catalog manipulation.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmbudibaseall versions3.39.19

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for budibase. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update budibase to 3.39.19 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qqf5-x7mj-v43p is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-qqf5-x7mj-v43p is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-qqf5-x7mj-v43p. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### 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 *
O3 Security · Impact-Aware SCA

Is GHSA-qqf5-x7mj-v43p in your dependencies?

O3 detects GHSA-qqf5-x7mj-v43p across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.