{"id":"CVE-2024-21511","aliases":["CLSA-2026-1773274566","EUVD-2024-1092","GHSA-4rch-2fh8-94vw","ROOT-APP-NPM-CVE-2024-21511"],"status":"published","title":"MySQL2 for Node Arbitrary Code Injection","description":"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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.01034,"percentile":0.64297,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-94"],"published":"2024-04-23T05:00:00Z","modified":"2026-10-28T02:31:02Z","fixes":[{"ecosystem":"npm","package":"mysql2","fixed_in":["3.9.7"],"sources":["ghsa","osv"]},{"ecosystem":"Root:npm","package":"mysql2","fixed_in":["2.3.3-aikido.3","3.7.1-aikido.4","3.9.2-aikido.1","3.9.2-aikido.2","2.3.3-aikido.4","3.7.1-aikido.3","3.9.7-aikido.2"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/mysql2","fixed_in":["2.3.3-root.io.2","2.3.3-root.io.1","2.3.3-root.io.3","3.7.1-root.io.4","3.9.2-root.io.1","3.9.2-root.io.2","2.3.3-root.io.4","3.7.1-root.io.3","3.9.7-root.io.1","3.9.7-root.io.2"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"mysql2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.9.7"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"mysql2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.3.3-tuxcare.0"},{"fixed":"2.3.3-tuxcare.2"}]}],"versions":["2.3.3","2.3.3-tuxcare.1"],"bundled":3},{"source":"osv","ecosystem":"npm","package":"mysql2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.9.7"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"mysql2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.3-aikido.3"},{"fixed":"3.7.1-aikido.4"},{"fixed":"3.9.2-aikido.1"},{"fixed":"3.9.2-aikido.2"},{"fixed":"2.3.3-aikido.4"},{"fixed":"3.7.1-aikido.3"},{"fixed":"3.9.7-aikido.2"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/mysql2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.3-root.io.2"},{"fixed":"2.3.3-root.io.1"},{"fixed":"2.3.3-root.io.3"},{"fixed":"3.7.1-root.io.4"},{"fixed":"3.9.2-root.io.1"},{"fixed":"3.9.2-root.io.2"},{"fixed":"2.3.3-root.io.4"},{"fixed":"3.7.1-root.io.3"},{"fixed":"3.9.7-root.io.1"},{"fixed":"3.9.7-root.io.2"}]}]}],"products":[{"vendor":"mysql2","product":"mysql2"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6670046","tags":["x_transferred","web"]},{"url":"https://github.com/sidorares/node-mysql2/releases/tag/v3.9.7","tags":["x_transferred","web"]},{"url":"https://github.com/sidorares/node-mysql2/pull/2608","tags":["x_transferred","fix","web"]},{"url":"https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713","tags":["x_transferred","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21511","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-4rch-2fh8-94vw"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/21xxx/CVE-2024-21511.json","tags":["advisory"]},{"url":"https://github.com/sidorares/node-mysql2","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-21511","description":"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.","status":"published","published":"2024-04-23T05:00:00.602Z","modified":"2024-08-01T22:20:40.911Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P","level":"critical","assessor":"cna"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:34:05.077718Z"}],"euvd":[{"id":"EUVD-2024-1092","description":"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.","status":"published","published":"2024-04-23T05:00:00Z","modified":"2024-08-01T22:20:40Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P","level":"critical"}],"updated_at":"2026-11-03T03:50:29.983832Z"}],"ghsa":[{"id":"GHSA-4rch-2fh8-94vw","title":"MySQL2 for Node Arbitrary Code Injection","description":"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.","status":"published","published":"2024-04-23T06:30:47Z","modified":"2024-04-23T20:50:58Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:37:44.335614Z"}],"nvd":[{"id":"CVE-2024-21511","description":"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.","status":"published","published":"2024-04-23T05:15:48.963Z","modified":"2026-06-17T07:09:38.807Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"secondary"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:09:53.50104Z"}],"osv":[{"id":"CVE-2024-21511","description":"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.","status":"published","published":"2024-04-23T05:00:00.602Z","modified":"2026-10-28T02:31:02.47116902Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P","level":"critical"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T15:44:38.577405Z"},{"id":"GHSA-4rch-2fh8-94vw","title":"MySQL2 for Node Arbitrary Code Injection","description":"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.","status":"published","published":"2024-04-23T06:30:47Z","modified":"2026-09-10T03:50:11.169102793Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T15:46:37.528068Z"},{"id":"CLSA-2026-1773274566","title":"TuxCare security update for mysql2 (3 CVEs)","description":"TuxCare rebuilt mysql2 to address 3 CVEs. Fixed in 2.3.3-tuxcare.2.","status":"published","published":"2026-08-04T14:52:12Z","modified":"2026-10-15T09:47:28.784236544Z","updated_at":"2026-11-02T15:43:43.621843Z"},{"id":"ROOT-APP-NPM-CVE-2024-21511","title":"CVE-2024-21511 in mysql2 - Patched by Root","description":"Root has patched CVE-2024-21511 in the mysql2 package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-09-11T12:50:21Z","modified":"2026-09-11T13:15:03.278162836Z","updated_at":"2026-11-02T15:53:27.362922Z"}]}}
