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).
PostgreSQL SET search_path SQL Injection
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.
public"; CREATE TABLE pwned AS SELECT usename, passwd FROM pg_shadow; --SET search_path TO "public"; CREATE TABLE pwned AS SELECT usename, passwd FROM pg_shadow; --;pg_shadow hashes, call pg_read_file(), or execute any DDL/DML.Microsoft SQL Server Schema Introspection SQL Injection
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).
dbo'; EXEC xp_cmdshell('whoami'); --xp_cmdshell is enabled.xp_cmdshell.MySQL multipleStatements: true + DESCRIBE Backtick Injection
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
foo`; DROP TABLE users; --.INFORMATION_SCHEMA.TABLES and inserts it into the DESCRIBE query.DROP TABLE payload executes.| Software | From | Fixed in |
|---|---|---|
budibase
|
- | 3.39.19 |
A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.
CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.
A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.
Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.
Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.
SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.