{"id":"GHSA-2xgg-r2wc-c5r2","title":"Budibase: MySQL DESCRIBE Backtick Injection via multipleStatements in Database Connector","summary":"Budibase: MySQL DESCRIBE Backtick Injection via multipleStatements in Database Connector","severity":"high","cvss":7.6,"cwe":["CWE-89"],"vendor":"budibase","product":"@budibase/server","ecosystem":"npm","affected":["@budibase/server <= 3.38.1"],"published":"2026-07-24","updated":"2026-07-24","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-2xgg-r2wc-c5r2","references":[{"url":"https://github.com/Budibase/budibase/security/advisories/GHSA-2xgg-r2wc-c5r2"},{"url":"https://github.com/Budibase/budibase/pull/18989"},{"url":"https://github.com/Budibase/budibase/commit/2c61f389c9986c91ddd8ae161c2b5e8ec21c60ac"},{"url":"https://github.com/Budibase/budibase/releases/tag/3.39.18"},{"url":"https://github.com/advisories/GHSA-2xgg-r2wc-c5r2"}],"tags":["ghsa","npm"],"ingestedAt":"2026-07-24T21:39:14.071Z","slug":"GHSA-2xgg-r2wc-c5r2","body":"## Overview\n\n### Summary\n**This is a related but independently fixable vulnerability to GHSA-qqf5-x7mj-v43p\n(PostgreSQL SQL injection), reported in the same original disclosure and\nsplit per GitHub CNA guidance (rule 4.2.11) since it affects a separate\nintegration, has a distinct attack precondition, and requires a separate\npatch.**\n\nThe MySQL integration enables `multipleStatements: true` on the connection,\npermitting semicolon-separated multi-statement execution. During table\nintrospection, table names retrieved from `INFORMATION_SCHEMA.TABLES` are\ninterpolated into a `DESCRIBE` query wrapped in backticks, but embedded\nbackticks in the table name are never escaped — allowing a malicious table\nname to break out and inject a second, attacker-controlled statement.\n\n### Details\n\n**Vulnerable Code:**\nFile: `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\nBecause `multipleStatements` is enabled, any statement appended after the\nbacktick break-out executes as a second query in the same round trip.\n\n### Step-by-Step Reproduction\n1. An attacker with the ability to create tables in the target MySQL\n   database (e.g. a lower-privileged database user, or a malicious actor in\n   a multi-tenant database) creates a table named:\n   ``foo`; DROP TABLE users; --``\n2. In Budibase, an administrator triggers schema introspection for that\n   database (e.g. opening the datasource or refreshing its table list).\n3. Budibase reads the malicious table name from `INFORMATION_SCHEMA.TABLES`\n   and interpolates it into the `DESCRIBE` query.\n4. The unescaped backtick terminates the identifier early, and the\n   semicolon-separated payload (enabled by `multipleStatements: true`)\n   executes as a second statement.\n\n### Impact\nArbitrary SQL execution triggered during routine schema discovery. Unlike\nthe PostgreSQL and MS SQL Server findings, this does not require the\nattacker to control the Budibase datasource configuration directly — only\nthe ability to create a maliciously named table in the underlying database\nbeforehand, with an administrator's normal use of the introspection feature\nserving as the trigger.\n\n## Affected packages\n\n- `@budibase/server <= 3.38.1`\n\n## Remediation\n\nRefer to the advisory for the patched release.","depth":"twilight","depthScore":42,"depthScoreParts":{"impact":41.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}