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