CVE-2026-55855: Mariadb SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-g5xc-5w98-jfvm
CVSS 6.5
CWE-116 CWE-89
Published
Advisory Summary

CVE-2026-55855 is a MODERATE (CVSS 6.5) sql injection vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Mariadb libraries in the npm ecosystem. The issue involves mariadb has possible sql injection in buffer parameter escaping under big5/gbk/sjis/cp932/gb18030 client charsets. Remediation is available by upgrading affected packages to version 3.2.4, 3.3.4, 3.4.6, 3.5.3.

CVE-2026-55855 at a Glance

CVE Identifier CVE-2026-55855
GHSA Identifier GHSA-g5xc-5w98-jfvm
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Mariadb
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-55855

To remediate this vulnerability, upgrade all affected Mariadb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mariadb fixed: 3.2.4
npm install mariadb@3.2.4
mariadb fixed: 3.3.4
npm install mariadb@3.3.4
mariadb fixed: 3.4.6
npm install mariadb@3.4.6
mariadb fixed: 3.5.3
npm install mariadb@3.5.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mariadb

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-55855, inspect your project dependencies using npm:

npm ls mariadb

Analyze the terminal output to locate any version of Mariadb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.4), your application is affected.

Note: The npm ls mariadb command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Mariadb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A SQL injection is possible when the connector escapes Buffer parameters client-side under a multi-byte client character set whose trail-byte range overlaps the ASCII backslash (0x5C): big5, gbk, sjis, cp932, and gb18030. Under these charsets, an attacker-controlled lead byte can absorb the escape byte the connector inserts, leaving the following quote unescaped so it terminates the string literal and injected SQL is parsed. ### Details When binding a Buffer (binary) parameter, the connector escapes the value byte-by-byte, inserting a backslash (0x5C) before quote (0x27) and backslash bytes. This is correct under single-byte and UTF-8–family charsets, but unsafe under client charsets whose multi-byte trail-byte range includes 0x5C. On the server, the SQL lexer performs multi-byte character recognition (my_ismbchar) before it interprets escape sequences. If character_set_client is one of the affected charsets and the attacker controls a byte the lexer treats as a valid lead byte, the sequence <lead-byte><0x5C> is consumed as a single multi-byte character. The escaping backslash inserted by the connector is swallowed as that character's trail byte, so the following 0x27 is no longer escaped — it closes the string literal, and the remaining bytes are parsed as SQL. This is the well-known multi-byte escaping bypass (the same class that historically affected addslashes / mysql_real_escape_string under GBK/Big5), here applied to the connector's client-side Buffer escaping path. ### Am I affected? You are affected if all of the following hold: You use mariadb Connector/Node.js at a version below the patched releases listed below. The connection's client character set is one of big5, gbk, sjis, cp932, or gb18030. This is not the default (the default is utf8mb4). Untrusted data can reach a Buffer-typed query parameter. Applications using utf8mb4 (or any charset whose trail-byte range does not include 0x5C) are not affected by this vector. Parameters bound through the binary/server-side prepared-statement path are also not affected, because those values are sent out-of-band and are never escaped into the SQL text. ### Impact SQL injection. An attacker able to influence the contents of a Buffer parameter can break out of the intended string literal and inject arbitrary SQL, leading to unauthorized read or modification of data and, depending on the database account's privileges, further compromise. ### Patches Fixed in 3.2.4, 3.3.3, 3.4.6, and 3.5.3. Upgrade to the patched release on your branch: * 3.5.x → 3.5.3 * 3.4.x → 3.4.6 * 3.3.x → 3.3.3 * 3.2.x and earlier → 3.2.4 (or any newer release) ### Workarounds If you cannot upgrade immediately: Use server-side prepared statements (execute) so parameters are bound via the binary protocol rather than escaped into the SQL text. Avoid passing untrusted data as Buffer parameters under the affected charsets. Credit Reported by Yalguun Tumenkhuu ([@fg0x0](https://github.com/fg0x0/)).

CVE-2026-55855 Affected Mariadb Versions

4 component(s)
Fixed Versions:
3.2.43.3.43.4.63.5.3
Product / Package Ecosystem Affected Versions Fixed Version
mariadb
npm
< 3.2.4
3.2.4
mariadb
npm
≥ 3.3.0
< 3.3.4
3.3.4
mariadb
npm
≥ 3.4.0
< 3.4.6
3.4.6
mariadb
npm
≥ 3.5.0
< 3.5.3
3.5.3

References

Frequently Asked Questions

What is CVE-2026-55855?
CVE-2026-55855 is a security vulnerability in Mariadb involving MariaDB has possible SQL injection in Buffer parameter escaping under big5/gbk/sjis/cp932/gb18030 client charsets under CWE-116: Improper Encoding or Escaping of Output.
Which Mariadb versions are affected?
Affected versions include releases prior to 3.2.4, 3.3.4, 3.4.6, 3.5.3 across affected packages: mariadb.
What version fixes CVE-2026-55855?
Upgrading to 3.2.4, 3.3.4, 3.4.6, 3.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mariadb affected?
Yes, mariadb is affected in releases prior to 3.2.4, 3.3.4, 3.4.6, 3.5.3. Upgrade your dependency to 3.2.4, 3.3.4, 3.4.6, 3.5.3 or later.
What is the CVSS score of CVE-2026-55855?
CVE-2026-55855 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2026-55855?
CVE-2026-55855 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check npm dependencies for CVE-2026-55855?
Run the dependency tree command: 'npm ls mariadb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g5xc-5w98-jfvm",
  "modified" : "2026-08-28T22:53:12Z",
  "published" : "2026-08-28T22:53:12Z",
  "aliases" : [ "CVE-2026-55855" ],
  "summary" : "MariaDB has  possible SQL injection in Buffer parameter escaping under big5/gbk/sjis/cp932/gb18030 client charsets",
  "details" : "### Summary\n\nA SQL injection is possible when the connector escapes Buffer parameters client-side under a multi-byte client character set whose trail-byte range overlaps the ASCII backslash (0x5C): big5, gbk, sjis, cp932, and gb18030. Under these charsets, an attacker-controlled lead byte can absorb the escape byte the connector inserts, leaving the following quote unescaped so it terminates the string literal and injected SQL is parsed.\n\n### Details\n\nWhen binding a Buffer (binary) parameter, the connector escapes the value byte-by-byte, inserting a backslash (0x5C) before quote (0x27) and backslash bytes. This is correct under single-byte and UTF-8–family charsets, but unsafe under client charsets whose multi-byte trail-byte range includes 0x5C.\n\nOn the server, the SQL lexer performs multi-byte character recognition (my_ismbchar) before it interprets escape sequences. If character_set_client is one of the affected charsets and the attacker controls a byte the lexer treats as a valid lead byte, the sequence <lead-byte><0x5C> is consumed as a single multi-byte character. The escaping backslash inserted by the connector is swallowed as that character's trail byte, so the following 0x27 is no longer escaped — it closes the string literal, and the remaining bytes are parsed as SQL.\n\nThis is the well-known multi-byte escaping bypass (the same class that historically affected addslashes / mysql_real_escape_string under GBK/Big5), here applied to the connector's client-side Buffer escaping path.\n\n### Am I affected?\n\nYou are affected if all of the following hold:\n\n\nYou use mariadb Connector/Node.js at a version below the patched releases listed below.\nThe connection's client character set is one of big5, gbk, sjis, cp932, or gb18030. This is not the default (the default is utf8mb4).\nUntrusted data can reach a Buffer-typed query parameter.\n\n\nApplications using utf8mb4 (or any charset whose trail-byte range does not include 0x5C) are not affected by this vector. Parameters bound through the binary/server-side prepared-statement path are also not affected, because those values are sent out-of-band and are never escaped into the SQL text.\n\n### Impact\n\nSQL injection. An attacker able to influence the contents of a Buffer parameter can break out of the intended string literal and inject arbitrary SQL, leading to unauthorized read or modification of data and, depending on the database account's privileges, further compromise.\n\n### Patches\n\nFixed in 3.2.4, 3.3.3, 3.4.6, and 3.5.3. Upgrade to the patched release on your branch:\n\n\n* 3.5.x → 3.5.3\n* 3.4.x → 3.4.6\n* 3.3.x → 3.3.3\n* 3.2.x and earlier → 3.2.4 (or any newer release)\n\n\n### Workarounds\n\nIf you cannot upgrade immediately:\n\nUse server-side prepared statements (execute) so parameters are bound via the binary protocol rather than escaped into the SQL text.\nAvoid passing untrusted data as Buffer parameters under the affected charsets.\n\n\nCredit\n\nReported by Yalguun Tumenkhuu ([@fg0x0](https://github.com/fg0x0/)).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mariadb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mariadb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.3.0"
      }, {
        "fixed" : "3.3.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 3.3.3"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mariadb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.4.0"
      }, {
        "fixed" : "3.4.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mariadb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.5.0"
      }, {
        "fixed" : "3.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/security/advisories/GHSA-g5xc-5w98-jfvm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/0148cadba48064d430902678bbc5b4b62dc1c04f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mariadb.org/browse/CONJS-350"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-28T22:53:12Z",
    "nvd_published_at" : null
  }
}