/

CVE-2026-64657

Severity:

HIGH RISK

(8.4)

SQL Injection (CWE-89) in Budibase PostgreSQL Connector

CVE-2026-64657

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution

Severity:

HIGH RISK

(8.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Budibase contains a SQL injection vulnerability in its PostgreSQL datasource connector when processing a user-controlled schema configuration value. An authenticated administrator who saves or tests a datasource may be able to execute unintended SQL, creating risks to database confidentiality, integrity, and availability.

Affected context

The issue affects Budibase deployments using the PostgreSQL datasource connector in versions before 3.39.19. It occurs when the connector builds a PostgreSQL SET search_path statement from the configured schema value without safely handling embedded double quotes, and the affected datasource is saved or tested.

Exploit preconditions

  • Attack surface: Budibase's PostgreSQL datasource configuration workflow
  • Required access: An authenticated account with administrator privileges sufficient to create, modify, save, or test a datasource
  • Trigger point: Datasource save or test operations that process the configured schema value
  • Why exploitation is possible: User-controlled schema content is interpolated into a SQL statement without adequate escaping or parameter-safe construction

Why this happens

The vulnerability results from constructing a SQL SET search_path statement by directly interpolating a user-controlled schema configuration value. Embedded delimiter characters are not safely escaped, allowing configuration data to alter the intended SQL statement structure. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection.

Potential impact

  • An attacker may execute unintended SQL statements within the datasource's database context.
  • Database records may be read, altered, or deleted, depending on the connected account's privileges.
  • Application data confidentiality and integrity could be affected.
  • Database availability may be disrupted through unauthorized operations.
  • Compromised database credentials or connected systems could increase the scope of impact.

General mitigation guidance

Mitigation centers on preventing configuration values from becoming executable SQL syntax.

Common defensive patterns include:

  • Constructing database commands with trusted APIs and safe identifier-handling mechanisms rather than raw string interpolation.
  • Validating schema and identifier values against an allowlist of permitted names.
  • Separating configuration data from SQL syntax wherever the database interface permits.
  • Limiting datasource credentials to the minimum required database privileges.
  • Restricting which administrators can create, modify, or test datasource connections.
  • Applying defense-in-depth database controls, including isolated roles and restricted network access.

How teams detect issues like this

Organizations can detect similar issues through:

  • Static analysis rules identifying string concatenation or interpolation in SQL construction.
  • Code review checks for user-controlled datasource fields used in identifiers or statements.
  • Tests that verify delimiter characters and unexpected identifier values cannot change generated SQL structure.
  • Database audit logging for unusual statements issued by Budibase datasource accounts.
  • Policy enforcement requiring parameterized queries or approved identifier-quoting APIs for database access.
  • Automated security review tools that flag untrusted input reaching SQL execution paths.

Sources

SourceLink
github.comgithub.com/Budibase/budibase/commit/67572a82c3850964f388bfd969779dc025a80224
github.comgithub.com/Budibase/budibase/security/advisories/GHSA-qqf5-x7mj-v43p

Frequently asked

questions

It may be exploitable through the Budibase administration interface when that interface is reachable and the attacker has the required administrator privileges.

Yes. The described attack requires an authenticated administrator who can save or test a PostgreSQL datasource.

Avoid interpolating user-controlled values into SQL statements. Use safe identifier-handling APIs, strict allowlists, and database roles with limited privileges.

Review all datasource configuration fields as untrusted input, test SQL-construction paths with adversarial values, enforce secure coding policies, and monitor database activity for unexpected statements.

Find out what's already
exploitable in your codebase.