Summary
A SQL injection vulnerability in Budibase's MySQL integration allows a database object name to be incorporated into a schema-discovery query without adequate escaping. If an attacker can create a MySQL table with a specially crafted name and a Budibase administrator later runs schema discovery, an additional SQL statement may execute.
Affected context
The issue occurs in Budibase deployments that use the MySQL integration for schema discovery and permit table names to be supplied by an actor who can create database objects. Risk is increased when the integration enables multiple SQL statements and an administrator performs discovery against the affected database.
Exploit preconditions
- Attack surface: Budibase's MySQL schema-discovery integration
- Required access: Ability to create or influence a MySQL table name in a database monitored by Budibase
- Trigger point: An administrator or other authorized process runs schema discovery
- Why exploitation is possible: The table name is incorporated into a DESCRIBE query without identifier-safe escaping while multiple statements are enabled
Why this happens
The vulnerability results from constructing SQL with an unescaped database identifier and allowing multiple statements in the same query operation. Although table names are identifiers rather than ordinary values, treating attacker-influenced identifiers as trusted query text can change the meaning of the statement and enable unintended SQL execution. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Potential impact
- An attacker may execute unauthorized SQL statements
- Database contents could be read, modified, or deleted
- Budibase-connected data sources could be altered or poisoned
- Application confidentiality, integrity, or availability could be affected
- Database credentials or connected-service access could be exposed
General mitigation guidance
Mitigation generally focuses on separating SQL structure from attacker-influenced data and reducing the capabilities available to integration credentials.
Common defensive patterns include:
- Escaping or quoting SQL identifiers with a database-aware routine before query construction
- Preferably using APIs that represent identifiers separately from SQL text
- Disabling multi-statement execution when it is not required
- Applying strict validation and length limits to database object names
- Using dedicated database accounts with only the schema and data privileges required
- Restricting who can create database objects used by application integrations
- Treating schema discovery as a privileged operation requiring appropriate authorization
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying string interpolation or concatenation in SQL queries
- Code review checks for attacker-controlled identifiers used without database-specific quoting
- Tests that verify table, column, and schema names cannot alter query structure
- Policies that prohibit multi-statement database connections unless explicitly justified
- Database audit logs showing unexpected statements during schema-discovery activity
- Automated security review tools that flag unsafe SQL construction patterns

