CVE-2012-2122: 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…
Noroxi assessment
Priority: Plan (action score 49/100)
- A ready-made attack module is public (Metasploit, Nuclei); exploiting it takes no special expertise.
- Public proof-of-concept code exists (Exploit-DB, GitHub); there is no record of exploitation in the wild.
- Probability of exploitation in the next 30 days: 96.6% (FIRST EPSS); higher than 99.8% of all records.
- Special conditions such as timing or configuration are required.
- Fixed version: mysql-5.1 (Debian:6.0) 5.1.63-0+squeeze1; mysql (Red Hat:enterprise_linux:6::client) 0:5.1.66-1.el6_3; mysql-bench (Red Hat:enterprise_linux:6::client) 0:5.1.66-1.el6_3.
Add it to your regular patch cycle. Upgrade to mysql-5.1 (Debian:6.0) 5.1.63-0+squeeze1; mysql (Red Hat:enterprise_linux:6::client) 0:5.1.66-1.el6_3; mysql-bench (Red Hat:enterprise_linux:6::client) 0:5.1.66-1.el6_3 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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.
- Published
- Jun 26, 2012
- Updated
- Jun 16, 2026
- EPSS
- 96.6% · 99th percentile
- CWE
- CWE-287
Report tools
Action score
49
Add it to your regular patch cycle.
- CVSS
- 20 / 40 · 5.1 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 29 / 30 · 96.6%
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- Weaponized exploit exists
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is MySQL on your server exposed to the internet?Run a port scan
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
Using mysql? Add it to your stack and be the first to know about CVEs like this one. (MySQL)
Is MySQL on your server exposed to the internet?
The free port scanner finds the open ports on your server and matches the service versions it can read against known vulnerabilities. No account needed.
Run a port scanAffected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- oracle mysql5.1.51
- oracle mysql5.1.52
- oracle mysql5.1.53
- oracle mysql5.1.54
- oracle mysql5.1.55
- oracle mysql5.1.56
- oracle mysql5.1.57
- oracle mysql5.1.58
+12 more rows
- oracle mysql5.1.59
- oracle mysql5.1.60
- oracle mysql5.1.61
- oracle mysql5.5.10
- oracle mysql5.5.11
- oracle mysql5.5.12
- oracle mysql5.5.13
- oracle mysql5.5.14
- oracle mysql5.5.15
- oracle mysql5.5.16
- oracle mysql5.5.17
- oracle mysql5.5.18
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:6.0 | mysql-5.1 | before 5.1.63-0+squeeze1 | 5.1.63-0+squeeze1 |
| Red Hat:enterprise_linux:6::client | mysql | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-bench | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-debuginfo | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-devel | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-embedded | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-embedded-devel | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-libs | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-server | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
| Red Hat:enterprise_linux:6::client | mysql-test | before 0:5.1.66-1.el6_3 | 0:5.1.66-1.el6_3 |
Same product
oracle: all recordsOther highest-scoring records for the same primary product.
- CVE-2016-6662Oracle MySQL through 5.5.52, 5.6.x through 5.6.33, and 5.7.x through 5.7.15; MariaDB before 5.5.51, 10.0.x before 10.0.27, and 10.1.x…59Plan
- CVE-2017-3599Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Server: Pluggable Auth).57Plan
- CVE-2009-4484Multiple stack-based buffer overflows in the CertDecoder::GetName function in src/asn.cpp in TaoCrypt in yaSSL before 1.9.9, as used in…51Plan
Published before and after this one in the same product
- ← EarlierCVE-2012-1697May 3, 2012 · Unspecified vulnerability in the MySQL Server component in Oracle MySQL 5.5.21 and earlier allows remote authenticated users to affect…17Monitor
- ← EarlierCVE-2012-1703May 3, 2012 · Unspecified vulnerability in the MySQL Server component in Oracle MySQL 5.1.61 and earlier, and 5.5.21 and earlier, allows remote…28Monitor
- Later →CVE-2012-0540Jul 17, 2012 · Unspecified vulnerability in Oracle MySQL Server 5.1.62 and earlier and 5.5.23 and earlier allows remote authenticated users to affect…17Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| debian:mysql-5.1 | 5.1.63-0+squeeze1 · Debian:6.0 | Package registry (OSV) |
| red hat:mysql | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-bench | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-debuginfo | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-devel | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-embedded | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-embedded-devel | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-libs | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-server | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
| red hat:mysql-test | 0:5.1.66-1.el6_3 · Red Hat:enterprise_linux:6::client | Package registry (OSV) |
Exploit status
Weaponized
A ready exploit tool or active in-the-wild use is known for this vulnerability. This should be your top priority.
Evidence
- Metasploit module ×1
- Exploit-DB entry ×1
- Nuclei detection template ×1
- Proof-of-concept repository on GitHub ×5
Noroxi does not host or link to exploit code. Metasploit module names and Nuclei template ids are shown (names, not code); Exploit-DB entries and PoC repositories are given as counts only.
| Source | Kind | Date |
|---|---|---|
| Proof-of-concept repository on GitHub | 5 repositories | 2013-05-09 → 2026-10-08 |
| Exploit-DB entry | remote | 2012-06-12 |
| Metasploit module | auxiliary/scanner/mysql/mysql_authbypass_hashdumpMySQL Authentication Bypass Password Dumpauxiliary | 2012-06-09 |
| Nuclei detection template | Nuclei template CVE-2012-2122 | — |
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
- Metasploit-18 d
- First PoC-15 d
- Published
- TodayNov 16, 2026+5256 d
Bug bounty scope
The product’s vendor appears in a public program. Matched by name; verify the scope text in the program.
Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate.
Technical details
Attack conditions
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- P · data can be read
- Integrity
- P · data or configuration can be modified
- Availability
- P · the service can be disrupted
- Attack complexity
- High
- Confidentiality impact
- P
- Integrity impact
- P
- Availability impact
- P
Weakness class (CWE)
CWE-287 · Improper AuthenticationCVSS vector
AV:N/AC:H/Au:N/C:P/I:P/A:P
nvd-primary
Root cause
Authentication is added route by route instead of being enforced in one place. When a route added later bypasses the shared middleware, the session check never runs for it.
The bug in code
The whole CWE-287 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
app.use("/admin", requireSession, adminRouter);
// Route added later skips the middleware
app.post("/admin-api/config", updateConfig);Fixed
const admin = express.Router();
admin.use(requireSession, requireRole("admin"));
admin.post("/config", updateConfig);
app.use("/admin", admin);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Authentication AbuseCAPEC-114Medium
- Authentication BypassCAPEC-115Medium
- Identity SpoofingCAPEC-151likelihood: Medium · Medium
- Fake the Source of DataCAPEC-194Medium
- Exploiting Trust in ClientCAPEC-22likelihood: High · High
- Utilizing REST's Trust in the System Resource to Obtain Sensitive DataCAPEC-57likelihood: Medium · Very High
- Session HijackingCAPEC-593likelihood: High · Very High
- Token ImpersonationCAPEC-633Medium
ATT&CK techniques
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (6 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.