{"id":"CVE-2024-21511","published":"2024-04-23T05:00:00Z","modified":"2024-08-01T22:20:40Z","title":"Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of…","vendor":null,"product":null,"tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01407,"percentile":0.72777,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6670046","tags":[]},{"url":"https://github.com/sidorares/node-mysql2/releases/tag/v3.9.7","tags":[]},{"url":"https://github.com/sidorares/node-mysql2/pull/2608","tags":[]},{"url":"https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713","tags":[]}],"priority":{"score":21.4,"factors":[{"name":"EPSS percentile","points":14.56},{"name":"CVSS severity","points":6.86}]},"affectedVersions":[{"vendor":"n/a","product":"mysql2","versions":["< 3.9.7"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2024-04-25T14:55:36.593699Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"mysql2","vulnerableRanges":["<3.9.7"],"patched":["3.9.7"],"from":["GHSA-4rch-2fh8-94vw"],"provenance":"source"}],"summary":{"text":"The mysql2 npm package, in versions before 3.9.7, contains a code injection flaw in its readCodeFor function, which fails to properly sanitise the timezone parameter before passing it to a native MySQL Server date/time function. An attacker who can reach the application over the network, with no authentication or user interaction required, can inject arbitrary code through the timezone input.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:14:37Z"},"euvd":{"id":"EUVD-2024-1092","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-21507","published":"2024-04-10","fixed":"3.9.3","kev":false},{"cve":"CVE-2024-21508","published":"2024-04-11","fixed":"3.9.4","kev":false,"link":{"from":"CVE-2024-21508","to":"CVE-2024-21511","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:mysql2","fromFixed":"3.9.4","toFixed":"3.9.7","daysApart":12},{"kind":"same-code","provenance":"machine","files":["lib/parsers/binary_parser.js","lib/parsers/text_parser.js"],"commits":["https://github.com/sidorares/node-mysql2/commit/74abf9ef94d76114d9a09415e28b496522a94805","https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713"],"basis":"shared file"}]}},{"cve":"CVE-2024-21509","published":"2024-04-10","fixed":"3.9.4","kev":false},{"cve":"CVE-2024-21511","published":"2024-04-23","fixed":"3.9.7","kev":false},{"cve":"CVE-2024-21512","published":"2024-05-29","fixed":"3.9.8","kev":false,"link":{"from":"CVE-2024-21511","to":"CVE-2024-21512","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:mysql2","fromFixed":"3.9.7","toFixed":"3.9.8","daysApart":36},{"kind":"same-code","provenance":"machine","files":["lib/parsers/binary_parser.js","lib/parsers/text_parser.js"],"commits":["https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713","https://github.com/sidorares/node-mysql2/commit/efe3db527a2c94a63c2d14045baba8dfefe922bc"],"basis":"shared file"}]}}],"package":"npm:mysql2"}}