CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-55855

CVE-2026-55855: SQL Injection in MariaDB Connector/Node.js via Multi-byte Client Character Sets

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 28, 2026·7 min read·0 visits

Executive Summary (TL;DR)

A client-side escaping flaw in MariaDB's Node.js driver allows SQL injection when using legacy multi-byte encodings (e.g., GBK, BIG5). Upgrading or switching to utf8mb4 mitigates the issue.

CVE-2026-55855 is a client-side SQL injection vulnerability in the MariaDB Connector/Node.js library that occurs when using legacy multi-byte character sets. The flaw arises from naive, byte-wise client-side parameter escaping. Attackers can leverage specific multi-byte lead bytes to absorb backslash escape characters on the server side, allowing them to terminate string literals and execute arbitrary SQL commands.

Vulnerability Overview

The MariaDB Connector/Node.js client library contains a critical client-side SQL injection vulnerability (CVE-2026-55855) within its query parameter escaping mechanism. This vulnerability affects applications that utilize the connector to interact with MariaDB or MySQL databases while configured with legacy multi-byte character sets. The attack surface is exposed via standard query parameter binding when using the text protocol, such as calling conn.query().

The core issue is classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command) and CWE-116 (Improper Encoding or Escaping of Output). By supplying carefully crafted binary or Buffer parameters, an attacker can manipulate the client-side escaping process to introduce unescaped single quotes. This allows arbitrary SQL execution with the privileges of the active database session.

Unlike vulnerabilities that rely on server-side flaws, this defect resides entirely within the client-side deserialization and stream serialization layers. The default utf8mb4 character set is structurally immune because it does not share the trail-byte characteristics that make the exploit possible. Similarly, the binary protocol, which uses server-side prepared statements via conn.execute(), is not affected.

Root Cause Analysis

The vulnerability represents a multi-byte character set (MBCS) SQL injection bypass. In legacy East Asian encodings such as big5, gbk, sjis, cp932, and gb18030, character sequences consist of variable-length bytes. A valid double-byte character begins with a lead byte followed by a trail byte.

The technical conflict arises because the valid range for a trail byte in these encodings includes 0x5C, which is the ASCII representation of the backslash character. For example, in the GBK encoding, the valid trail-byte range is 0x40 to 0x7E and 0x80 to 0xFE. Because the backslash character 0x5C falls within these ranges, a valid multi-byte character can end with a backslash.

When client-side escaping is performed naively, the library processes the user-provided Buffer parameter byte-by-byte. If an attacker passes a lead byte (like 0xBF in GBK) followed by a single quote (0x27), the naive escaper inserts an escape byte (0x5C) before the quote. The resulting raw sequence transmitted over the wire is 0xBF 0x5C 0x27.

The final stage of the bypass occurs on the database server. The database's SQL lexer checks for multi-byte character structures before processing escape characters. When the server scans 0xBF 0x5C, it interprets this sequence as a single valid multi-byte character rather than an escaped character. This leaves the subsequent 0x27 single quote unescaped, terminating the SQL string literal and enabling SQL injection.

Code Analysis

The vulnerability resides in lib/io/packet-output-stream.js within the writeBufferEscape method, which was renamed to writeBufferEscapeFast. This method walked through the input buffer byte-by-byte without checking the multi-byte boundaries of the connection's active encoding.

Below is the vulnerable implementation of the byte-wise escaping loop:

// Vulnerable implementation in lib/io/packet-output-stream.js
writeBufferEscapeFast(val) {
  let valLen = val.length;
  for (let i = 0; i < valLen; i++) {
    const b = val[i];
    if (b === QUOTE || b === SLASH || b === DBL_QUOTE || b === ZERO_BYTE) {
      this.buf[this.pos++] = SLASH; // Inserts 0x5C indiscriminately
    }
    this.buf[this.pos++] = b;
  }
}

The patch remedies this by introducing a stateful, charset-aware loop. The method writeBufferEscapeMb uses a character recognizer (such as getMbRecognizer(encoding) from lib/misc/charset-mb.js) to parse valid multi-byte sequences.

// Patched implementation utilizing charset-aware logic
writeBufferEscapeMb(mb, val) {
  const valLen = val.length;
  let i = 0;
  while (i < valLen) {
    const b = val[i];
    if (mb.isHead(b)) {
      const mbLen = mb.length(val, i, valLen);
      if (mbLen >= 2) {
        for (let j = 0; j < mbLen; j++) {
          this.buf[this.pos++] = val[i + j];
        }
        i += mbLen;
        continue;
      }
      this.buf[this.pos++] = SLASH;
      this.buf[this.pos++] = b;
      i++;
      continue;
    }
    if (b === QUOTE || b === SLASH || b === DBL_QUOTE || b === ZERO_BYTE) {
      this.buf[this.pos++] = SLASH;
    }
    this.buf[this.pos++] = b;
    i++;
  }
}

This modification ensures that if a sequence forms a valid multi-byte character, it passes through untouched. If a lone lead byte is provided, it is escaped as \ followed by the lead byte, neutralizing the attack vector.

Exploitation

To successfully exploit this vulnerability, the target application must connect to a MariaDB or MySQL database using a legacy multi-byte character set such as GBK, BIG5, or SJIS. The database connection must be configured to use this encoding, and the query must use the text-protocol interface via conn.query().

The attacker must have a vector to supply raw buffer or binary parameters to the query. If the parameter is parsed as a string on the Node.js side before serialization, the encoding conversions might corrupt the high-order bytes before they reach the escaper. However, when the input is passed directly as a Buffer or binary parameter, the raw bytes are processed exactly as provided.

An attack sequence begins by generating a payload where a valid lead byte immediately precedes the character to be escaped. For example, using GBK, the byte 0xBF is a valid lead byte. An input of 0xBF 0x27 0x20 0x4f 0x52... translates to ¿' OR.... The client-side escaper converts this to 0xBF 0x5C 0x27 0x20 0x4f 0x52....

The database server treats 0xBF 0x5C as a single character (縗), causing the backslash to disappear. The parser then processes 0x27 (the single quote) as a control character rather than a literal value. This breaks out of the SQL string literal, appending the attacker's commands to the query structure.

Impact Assessment

The security impact of CVE-2026-55855 is critical, as it facilitates unauthenticated remote SQL injection. Depending on the architecture of the backend database, an attacker can bypass authentication mechanisms, retrieve sensitive system data, modify records, or execute administrative actions.

The CVSS v3.1 base score is established at 6.5 (Medium) with the vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N. The complexity is designated as high because of the requirement for specific legacy multi-byte character sets to be active on the client connection. If these encodings are active, the vulnerability can be exploited with low complexity.

The vulnerability does not allow direct remote code execution on the underlying operating system unless database-level features (such as LOAD DATA INFILE or specific user-defined functions) are misconfigured or accessible. However, the compromise of database integrity and confidentiality remains high.

Remediation & Detection

The primary remediation strategy is upgrading the mariadb npm package to a patched version. Fixed versions have been released across all supported release branches: 3.2.4 (for 3.2.x), 3.3.3 (for 3.3.x), 3.4.6 (for 3.4.x), and 3.5.3 (for 3.5.x).

If immediate upgrading is not feasible, several defensive workarounds can be applied. The most effective mitigation is migrating database connections to the modern, standard utf8mb4 character set. This encoding does not suffer from trail-byte conflicts and is completely immune to backslash-swallowing attacks.

// Secure Connection Setup using modern UTF-8
const connection = await mariadb.createConnection({
  host: "db.local",
  user: "app_user",
  charset: "utf8mb4" // Immune to CVE-2026-55855
});

Additionally, developers should replace conn.query() with conn.execute() for parameterized queries. The conn.execute() interface utilizes the binary prepared statement protocol on the server side. Because parameter values are bound separately from the SQL statement template, they are never processed by the SQL lexer, eliminating client-side text escaping entirely.

Official Patches

MariaDBGitHub Security Advisory (GHSA-g5xc-5w98-jfvm)
MariaDBJIRA Ticket CONJS-350

Fix Analysis (1)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N

Affected Systems

mariadb-connector-nodejs

Affected Versions Detail

Product
Affected Versions
Fixed Version
mariadb-connector-nodejs
MariaDB
< 3.2.43.2.4
mariadb-connector-nodejs
MariaDB
>= 3.3.0, < 3.3.33.3.3
mariadb-connector-nodejs
MariaDB
>= 3.4.0, < 3.4.63.4.6
mariadb-connector-nodejs
MariaDB
>= 3.5.0, < 3.5.33.5.3
AttributeDetail
CWE IDCWE-89 / CWE-116
Attack VectorNetwork
CVSS Severity6.5 (Medium)
Exploit StatusProof-of-Concept
KEV StatusNot Listed
ImpactClient-Side SQL Injection Bypass

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-89
SQL Injection

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Vulnerability Timeline

Vulnerability reported by researcher and remediation patch authored.
2026-05-25
CVE-2026-55855 / GHSA-g5xc-5w98-jfvm published.
2026-08-28

References & Sources

  • [1]Advisory GHSA-g5xc-5w98-jfvm
  • [2]Issue CONJS-350
  • [3]CVE-2026-55855

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•CVE-2026-55761
7.1

CVE-2026-55761: Improper Authentication Vulnerability in Portainer Community Edition

An improper authentication vulnerability (CWE-287) in Portainer Community Edition (CE) allows unauthenticated remote attackers to achieve full administrative takeover. During the initial five-minute uninitialized setup window, sensitive endpoints responsible for creating the initial administrator user and restoring database state are publicly accessible without authentication. Attackers can exploit this to create administrative credentials or overwrite the system state with a malicious database configuration.

Alon Barad
Alon Barad
2 views•7 min read
•about 3 hours ago•CVE-2026-55678
6.9

CVE-2026-55678: Unauthenticated Node Registration and Credential Leakage in Arc Enterprise Clustering

CVE-2026-55678 defines a critical security vulnerability in the Enterprise clustering implementation of Arc, an open-source SQL-native time-series database. When clustering is enabled but a shared secret is not defined, the cluster coordinator fails to enforce authentication on cluster join requests and node status updates. Remote, unauthenticated attackers can exploit this behavior to register a rogue node, hijack telemetry routing, and harvest sensitive client authentication headers.

Alon Barad
Alon Barad
8 views•6 min read
•about 5 hours ago•CVE-2026-55247
9.1

CVE-2026-55247: Multiple Vulnerabilities (DoS, SSRF, and Stored XSS) in plone.app.event iCalendar Import

A critical security vulnerability exists in plone.app.event, the event content type package for the Plone CMS. Prior to versions 5.2.4 and 6.0.1, the iCalendar import component lacked proper file size controls, URL scheme validation, and network isolation filters. Authenticated editors could exploit these deficiencies to cause denial of service via memory exhaustion, read local files, perform server-side request forgery, and inject stored cross-site scripting vectors.

Alon Barad
Alon Barad
6 views•6 min read
•about 6 hours ago•CVE-2026-55479
5.3

CVE-2026-55479: Incorrect Authorization Check in Snipe-IT Legacy License Check-in Flow

Snipe-IT prior to version 8.6.2 is vulnerable to an incorrect authorization flaw (CWE-863) within its legacy single-seat license check-in workflow. The application incorrectly validates authorization using the 'checkout' permission instead of the 'checkin' permission. This allows authenticated users who are authorized only to assign licenses, but explicitly restricted from unassigning them, to directly access and execute license seat check-ins, bypassing intended role-based access controls.

Amit Schendel
Amit Schendel
7 views•4 min read
•about 7 hours ago•CVE-2026-55068
9.3

CVE-2026-55068: Network Function Registration Poisoning in free5GC NRF

Improper input validation in the free5GC Network Repository Function (NRF) enables attackers with Service-Based Interface (SBI) access to register poisoned Network Function (NF) profiles, facilitating control-plane redirection and credential sniffing.

Amit Schendel
Amit Schendel
12 views•6 min read
•about 8 hours ago•CVE-2026-54736
8.2

CVE-2026-54736: Timing Side-Channel Vulnerability in Phalcon Crypt Decryption

Phalcon versions prior to 5.14.1 are vulnerable to a timing side-channel attack in the authenticated decryption process. The HMAC signature verification utilizes a non-constant-time byte comparison, allowing unauthenticated remote attackers to reconstruct valid signatures and forge arbitrary encrypted payloads.

Alon Barad
Alon Barad
6 views•6 min read