{"id":"CVE-2012-2122","published":"2012-06-26T18:00:00Z","modified":"2024-08-06T19:26:07Z","title":"sql/password.c in Oracle MySQL 5.1.x before 5.1.63, 5.5.x before 5.5.24, and 5.6.x before 5.6.6, and MariaDB 5.1.x…","vendor":null,"product":null,"tier":"core","eol":null,"description":{"text":"sql/password.c in Oracle MySQL 5.1.x before 5.1.63, 5.5.x before 5.5.24, and 5.6.x before 5.6.6, and MariaDB 5.1.x before 5.1.62, 5.2.x before 5.2.12, 5.3.x before 5.3.6, and 5.5.x before 5.5.23, when running in certain environments with certain implementations of the memcmp function, allows remote attackers to bypass authentication by repeatedly authenticating with the same incorrect password, which eventually causes a token comparison to succeed due to an improperly-checked return value.","provenance":"source","from":"CVE.org"},"summary":{"text":"The flaw lies in sql/password.c of Oracle MySQL (5.1.x before 5.1.63, 5.5.x before 5.5.24, and 5.6.x before 5.6.6) and MariaDB (5.1.x before 5.1.62, 5.2.x before 5.2.12, 5.3.x before 5.3.6, and 5.5.x before 5.5.23), where a token comparison relies on an improperly checked return value from memcmp in certain environments. A remote attacker can bypass authentication by repeatedly logging in with the same incorrect password until the comparison succeeds, and this requires that the server run in an environment with a particular memcmp implementation.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T07:15:22Z"},"cvss":null,"epss":{"score":0.96619,"percentile":0.99883,"date":"2026-10-30","provenance":"source"},"kev":null,"vulncheckKev":null,"exploited":false,"otx":{"pulseCount":2,"pulses":[{"name":"CVE Data","url":"https://otx.alienvault.com/pulse/69929b597293fe5837b9c95c","created":"2026-02-16"},{"name":"Python: OVSAgentServer Document (autofilled name)","url":"https://otx.alienvault.com/pulse/6660c1268a1f430e17236b55","created":"2024-06-05"}],"provenance":"machine"},"cwes":[],"references":[{"url":"http://bugs.mysql.com/bug.php?id=64884","tags":["x_refsource_MISC"]},{"url":"http://www.securityfocus.com/bid/53911","tags":["vdb-entry","x_refsource_BID"]},{"url":"http://www.exploit-db.com/exploits/19092","tags":["exploit","x_refsource_EXPLOIT-DB"]},{"url":"http://secunia.com/advisories/53372","tags":["third-party-advisory","x_refsource_SECUNIA"]},{"url":"http://security.gentoo.org/glsa/glsa-201308-06.xml","tags":["vendor-advisory","x_refsource_GENTOO"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2012-08/msg00007.html","tags":["vendor-advisory","x_refsource_SUSE"]},{"url":"https://community.rapid7.com/community/metasploit/blog/2012/06/11/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql","tags":["x_refsource_MISC"]},{"url":"http://securitytracker.com/id?1027143","tags":["vdb-entry","x_refsource_SECTRACK"]},{"url":"http://secunia.com/advisories/49417","tags":["third-party-advisory","x_refsource_SECUNIA"]},{"url":"http://seclists.org/oss-sec/2012/q2/493","tags":["mailing-list","x_refsource_MLIST"]},{"url":"http://kb.askmonty.org/en/mariadb-5162-release-notes/","tags":["x_refsource_CONFIRM"]}],"techniques":[],"reports":[],"affected":[],"advisories":[],"euvd":{"id":"EUVD-2012-2124","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2012-2124","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[{"id":19092,"url":"https://www.exploit-db.com/exploits/19092","title":"MySQL - Authentication Bypass","type":"remote","platform":"multiple","date":"2012-06-12","verified":true,"provenance":"source"}],"exploitSources":{"exploitdb":{"count":1,"earliest":"2012-06-12"},"pocGithub":{"count":4,"skipped":1,"earliest":"2013-05-09","earliestUrl":"https://github.com/Avinza/CVE-2012-2122-scanner","repos":[{"name":"Avinza/CVE-2012-2122-scanner","url":"https://github.com/Avinza/CVE-2012-2122-scanner","stars":1,"created":"2013-05-09"},{"name":"cyberharsh/Oracle-mysql-CVE-2012-2122","url":"https://github.com/cyberharsh/Oracle-mysql-CVE-2012-2122","stars":1,"created":"2020-06-24"},{"name":"netw0rk7/CVE-2012-2122-Home-Lab","url":"https://github.com/netw0rk7/CVE-2012-2122-Home-Lab","stars":0,"created":"2025-11-24"},{"name":"CyberCTF/vulhub-mysql-cve-2012-2122","url":"https://github.com/CyberCTF/vulhub-mysql-cve-2012-2122","stars":0,"created":"2026-10-08"}]},"metasploit":[{"name":"MySQL Authentication Bypass Password Dump","module":"auxiliary/scanner/mysql/mysql_authbypass_hashdump","type":"auxiliary","disclosureDate":"2012-06-09","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/auxiliary/scanner/mysql/mysql_authbypass_hashdump.rb"}],"nuclei":[{"id":"CVE-2012-2122","name":"MySQL - Authentication Bypass","severity":"medium","path":"javascript/cves/2012/CVE-2012-2122.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/javascript/cves/2012/CVE-2012-2122.yaml"}],"first":{"date":"2012-06-09","source":"Metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/auxiliary/scanner/mysql/mysql_authbypass_hashdump.rb"},"provenance":"source"},"exploitRefs":["http://www.exploit-db.com/exploits/19092"],"flow":[],"timeline":[{"date":"2012-06-09","kind":"exploit-public","label":"First public exploit: Metasploit; later: Exploit-DB 2012-06-12, PoC-in-GitHub 2013-05-09","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/auxiliary/scanner/mysql/mysql_authbypass_hashdump.rb","provenance":"source"},{"date":"2012-06-26","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2012-2122","provenance":"source"}],"speed":{"daysToPublicExploit":null,"firstExploitFrom":"Metasploit","daysToKev":null},"priority":{"score":26.1,"factors":[{"name":"In a KEV catalog","points":0.0,"detail":"not listed"},{"name":"Recent KEV listing","points":0.0,"detail":"not listed"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.98,"detail":"percentile 0.9988"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":5.0,"detail":"1 NVD reference tagged Exploit; 1 Exploit-DB entry; 4 PoC-in-GitHub repos; 1 Metasploit module; 1 nuclei template"},{"name":"Mentioned in OTX pulses","points":1.08,"detail":"2 pulses"},{"name":"CVSS severity","points":0.0,"detail":"no CVSS"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]}}