CVE-2007-2692
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedThe mysql_change_db function in MySQL 5.0.x before 5.0.40 and 5.1.x before 5.1.18 does not restore THD::db_access privileges when returning from SQL SECURITY INVOKER stored routines, which allows remote authenticated users to gain privileges.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceThe mysql_change_db function in MySQL 5.0.x before 5.0.40 and 5.1.x before 5.1.18 fails to restore THD::db_access privileges when returning from SQL SECURITY INVOKER stored routines, allowing authenticated users to retain elevated privileges beyond their intended scope.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data= 5.0.0= 5.0.1= 5.0.2= 5.0.3= 5.0.4= 5.0.5= 5.0.5.0.21= 5.0.10= 5.0.15= 5.0.16= 5.0.17= 5.0.20= 5.0.0= 5.0.3= 5.0.6= 5.0.7= 5.0.8= 5.0.9= 5.0.11= 5.0.12= 5.0.13= 5.0.14= 5.0.18= 5.0.19CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- M
- Authentication
- Single
- Confidentiality
- Partial
- Integrity
- Partial
- Availability
- Partial
AV:N/AC:M/Au:S/C:P/I:P/A:P
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Check installed MySQL server versionRun SELECT VERSION(); or mysqld --version from command lineAffected if Version is 5.0.x before 5.0.40 or 5.1.x before 5.1.18 (e.g., 5.0.20, 5.1.10)
-
Identify SQL SECURITY INVOKER stored routinesQuery the mysql.routines table: SELECT ROUTINE_NAME, ROUTINE_TYPE, SECURITY_TYPE FROM mysql.routines WHERE SECURITY_TYPE = 'INVOKER';Affected if Any stored procedures or functions with SECURITY_TYPE = 'INVOKER' exist in the database
-
Verify database-level privileges configurationRun SHOW GRANTS FOR CURRENT_USER(); to view current user's privileges, especially at the database levelAffected if User has limited db-level privileges but unexpectedly accesses tables in databases where they lack explicit grants
-
Test for privilege escalation behaviorCreate a test INVOKER stored procedure that references a table in a database where the invoker lacks direct privileges, then execute it as a restricted userAffected if The restricted user can access tables they should not have access to after calling the INVOKER routine
You are affected if running MySQL 5.0.x before 5.0.40 or 5.1.x before 5.1.18 AND you use SQL SECURITY INVOKER stored routines that access tables in databases where the invoker lacks explicit privileges.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
From vendor dataUpgrade MySQL server to version 5.0.40 or later for 5.0.x branches, or 5.1.18 or later for 5.1.x branches. Alternatively, avoid using SQL SECURITY INVOKER stored routines until the patch is applied.
- Consultation4.0 h
- Implementation8.0 h
- Testing6.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,600.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2007-2692 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sources- secunia.com
- bugs.mysql.com
- dev.mysql.com
- lists.mysql.com
- lists.opensuse.org
- osvdb.org
- secunia.com
- secunia.com
- secunia.com
- secunia.com
- secunia.com
- secunia.com
- secunia.com
- www.debian.org
- www.mandriva.com
- www.redhat.com
- www.redhat.com
- www.securityfocus.com
- www.securityfocus.com
- www.securitytracker.com
- www.ubuntu.com
- www.vupen.com
- exchange.xforce.ibmcloud.com
- issues.rpath.com
- oval.cisecurity.org
- nvd.nist.gov
Practitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2007-2692 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data