[UNIX] PostgreSQL to_ascii() Buffer Overflow Vulnerability

From: SecuriTeam (support_at_securiteam.com)
Date: 11/02/03

  • Next message: SecuriTeam: "[NEWS] Citrix Metaframe XP is vulnerable to Cross Site Scripting"
    To: list@securiteam.com
    Date: 2 Nov 2003 19:05:44 +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

    - - - - - - - - -

      PostgreSQL to_ascii() Buffer Overflow Vulnerability
    ------------------------------------------------------------------------

    SUMMARY

    PostgreSQL contains a buffer overflow vulnerability in its to_ascii()
    function. The to_ascii() function is used to convert text from multibyte
    encoding format to ASCII, and due to improper bounds checking and
    unsigned/signed calculations a buffer overflow may occur.

    DETAILS

    Vulnerable systems:
     * PostgreSQL version 7.2.x
     * PostgreSQL version 7.3.1, 7.3.2, 7.3.3

    Immune systems:
     * PostgreSQL version 7.3.4

    In line 66 of the ascii.c it can be clearly seen that:
             for (x = src; x <= src_end; x++)
             {
                     if (*x < 128)
                             *desc++ = *x;

    The 'x' parameter runs from src to src_end (including), this means that an
    off by one will occur.

    Another problem that also resides in the code:
     pg_to_ascii(
                                     (unsigned char *) VARDATA(data), /* src
    */
                                     VARDATA(data) + VARSIZE(data), /* src end
    */
                                     (unsigned char *) VARDATA(data), /* desc
    */
                                     enc); /* encoding */

    The fact that VARDATA(data) + VARSIZE(data) is calculated, while their
    types differ, could cause the number/pointer returned by this to point to
    a negative number, allowing overwriting of arbitrary bytes in the memory
    (the fix of course is to do a (unsigned char *) casting on the first
    variable).

    ADDITIONAL INFORMATION

    The information has been provided by OpenPKG.

    The vulnerability has been discovered by Guido Notari.

    ========================================

    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: "[NEWS] Citrix Metaframe XP is vulnerable to Cross Site Scripting"

    Relevant Pages

    • [NT] Borland Products idsql32.dll Buffer Overflow Vulnerability
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Borland Products idsql32.dll Buffer Overflow Vulnerability ... processing SQL statements using the "DbiQExec" function. ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
      (Securiteam)
    • [EXPL] phpStat Authentication Bypass Vulnerability (Exploit, Setup.PHP)
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... phpStat is vulnerable to an authentication bypass vulnerability, ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
      (Securiteam)
    • [UNIX] phpBB Modified By Przemo Arbitary Code Execution
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... A directory traversal vulnerability and insecure file inclusion ... script that contains arbitrary code. ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
      (Securiteam)
    • [EXPL] Security vulnerability in SUNs Java Virtual Machine Implementation (Test)
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Vulnerability in SUN's Java Virtual Machine Implementation ('/' Replaces ... The following applet tests for this vulnerability: ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
      (Securiteam)
    • [UNIX] AspApp SQL Injection and Cross Site Scripting
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Vulnerabilities were discovered in AspApp allowing malicious users to ... The following URLs can be used to trigger the vulnerability: ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
      (Securiteam)