GHSA-Q6X4-V3QX-85QW

Vulnerability from github – Published: 2026-07-24 21:15 – Updated: 2026-07-24 21:15
VLAI
Summary
Budibase: SQL Injection via `multipleStatements: true`
Details

Summary

A critical SQL injection vulnerability was discovered in Budibase's MySQL integration that allows remote attackers to execute arbitrary SQL commands.

Details

Vulnerability Type

SQL Injection

Description

The MySQL integration component in Budibase is configured with multipleStatements: true, enabling execution of multiple SQL statements in a single query. Attackers can inject malicious SQL commands through user input fields, leading to complete database compromise.

Location

// File: packages/server/src/integrations/mysql.ts
// Line: 173

this.config = {
  ...config,
  typeCast: defaultTypeCasting,
  multipleStatements: true,  // VULNERABLE
  timezone: "Z",
}

Proof of Concept

Exploit

const mysql = require('mysql2');

// Budibase vulnerable configuration
const connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  password: 'password',
  multipleStatements: true,  // Vulnerable setting
  timezone: "Z"
});

// Attack: Data destruction
connection.query(
  `SELECT * FROM users WHERE id = 1; DROP TABLE sensitive_data; --`,
  (err, results) => {
    if (!err) console.log("Table dropped successfully");
  }
);

Impact

  • Data Destruction: Execute DROP TABLE, DELETE commands
  • Data Theft: Exfiltrate data via SELECT INTO OUTFILE
  • Privilege Escalation: Grant database admin privileges
  • Denial of Service: Disrupt service operations
  • Complete Database Compromise: Full control over database

Remediation

Patch

--- a/packages/server/src/integrations/mysql.ts
+++ b/packages/server/src/integrations/mysql.ts
@@ -170,7 +170,7 @@ class MySQLIntegration extends Sql implements DatasourcePlus {
     this.config = {
       ...config,
       typeCast: defaultTypeCasting,
-      multipleStatements: true,
+      multipleStatements: false,
       timezone: "Z",
     }
   }

Workarounds

  1. Temporarily disable MySQL integration
  2. Implement web application firewall (WAF)
  3. Restrict database user privileges
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@budibase/server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "3.38.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-24T21:15:02Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "## Summary\nA critical SQL injection vulnerability was discovered in Budibase\u0027s MySQL integration that allows remote attackers to execute arbitrary SQL commands.\n\n## Details\n### Vulnerability Type\nSQL Injection\n\n### Description\nThe MySQL integration component in Budibase is configured with `multipleStatements: true`, enabling execution of multiple SQL statements in a single query. Attackers can inject malicious SQL commands through user input fields, leading to complete database compromise.\n\n### Location\n```typescript\n// File: packages/server/src/integrations/mysql.ts\n// Line: 173\n\nthis.config = {\n  ...config,\n  typeCast: defaultTypeCasting,\n  multipleStatements: true,  // VULNERABLE\n  timezone: \"Z\",\n}\n```\n\n## Proof of Concept\n\n### Exploit\n```javascript\nconst mysql = require(\u0027mysql2\u0027);\n\n// Budibase vulnerable configuration\nconst connection = mysql.createConnection({\n  host: \u0027localhost\u0027,\n  user: \u0027root\u0027,\n  password: \u0027password\u0027,\n  multipleStatements: true,  // Vulnerable setting\n  timezone: \"Z\"\n});\n\n// Attack: Data destruction\nconnection.query(\n  `SELECT * FROM users WHERE id = 1; DROP TABLE sensitive_data; --`,\n  (err, results) =\u003e {\n    if (!err) console.log(\"Table dropped successfully\");\n  }\n);\n```\n\n## Impact\n- **Data Destruction**: Execute DROP TABLE, DELETE commands\n- **Data Theft**: Exfiltrate data via SELECT INTO OUTFILE\n- **Privilege Escalation**: Grant database admin privileges\n- **Denial of Service**: Disrupt service operations\n- **Complete Database Compromise**: Full control over database\n\n## Remediation\n### Patch\n```diff\n--- a/packages/server/src/integrations/mysql.ts\n+++ b/packages/server/src/integrations/mysql.ts\n@@ -170,7 +170,7 @@ class MySQLIntegration extends Sql implements DatasourcePlus {\n     this.config = {\n       ...config,\n       typeCast: defaultTypeCasting,\n-      multipleStatements: true,\n+      multipleStatements: false,\n       timezone: \"Z\",\n     }\n   }\n```\n\n### Workarounds\n1. Temporarily disable MySQL integration\n2. Implement web application firewall (WAF)\n3. Restrict database user privileges",
  "id": "GHSA-q6x4-v3qx-85qw",
  "modified": "2026-07-24T21:15:02Z",
  "published": "2026-07-24T21:15:02Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/Budibase/budibase/security/advisories/GHSA-q6x4-v3qx-85qw"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Budibase/budibase"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Budibase/budibase/releases/tag/3.40.0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": " Budibase: SQL Injection via `multipleStatements: true`"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…