{"id":"CVE-2024-21511","aliases":["CVE-2024-21511","GHSA-4rch-2fh8-94vw"],"related":[],"kind":"vulnerability","state":"published","title":"MySQL2 for Node Arbitrary Code Injection","summary":"Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of the timezone parameter in the readCodeFor function by calling a native MySQL Server date/time function.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of the timezone parameter in the readCodeFor function by calling a native MySQL Server date/time function.","source":"cvelist"},{"lang":"es","text":"Las versiones del paquete mysql2 anteriores a la 3.9.7 son vulnerables a la inyección de código arbitrario debido a una sanitización inadecuada del parámetro de zona horaria en la función readCodeFor al llamar a una función de fecha/hora nativa del servidor MySQL.","source":"nvd"}],"published":"2024-04-23T05:00:00.602Z","modified":"2026-09-10T03:50:11.169Z","severity":{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"3.9.7","status":"affected"}],"product":"mysql2","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"3.9.7","status":"affected"}],"vendor":"mysql2","product":"mysql2","cpe":"cpe:2.3:a:mysql2:mysql2:-:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.9.7"}],"ecosystem":"npm","package":"mysql2","purl":"pkg:npm/mysql2","source":"ghsa"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6670046","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sidorares/node-mysql2/releases/tag/v3.9.7","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sidorares/node-mysql2/pull/2608","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21511","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/sidorares/node-mysql2","tags":["package"],"sources":["ghsa"]}],"credits":["zhaoyudi (Nebulalab)"],"assigner":"snyk","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2024-04-25T14:55:36.593Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-21511","url":"https://www.cve.org/CVERecord?id=CVE-2024-21511","licence":"CVE Terms of Use","modified":"2024-08-01T22:20:40.911Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4rch-2fh8-94vw","url":"https://github.com/advisories/GHSA-4rch-2fh8-94vw","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:11.169Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-21511","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21511","licence":"Public domain","modified":"2026-06-17T07:09:38.807Z"}],"updatedAt":"2026-11-25T22:58:39.521Z","epss":{"score":0.01034,"percentile":0.64777,"date":"2026-12-01T12:00:22.000Z"}}