[UNIX] chmlib CHM File Handling Buffer Overflow

From: SecuriTeam (support_at_securiteam.com)
Date: 10/31/05

  • Next message: SecuriTeam: "[NEWS] Skype Buffer Overflow"
    To: list@securiteam.com
    Date: 31 Oct 2005 08:49:04 +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

    - - - - - - - - -

      chmlib CHM File Handling Buffer Overflow
    ------------------------------------------------------------------------

    SUMMARY

    " <http://morte.jedrea.com/~jedwin/projects/chmlib/> CHMLIB is a library
    for dealing with Microsoft ITSS/CHM format files. " The chmlib library
    does not validate the length of buffers it receives, allowing attackers to
    cause it to overflow internal buffers and as a result execute arbitrary
    code.

    DETAILS

    Vulnerable Systems:
     * chmlib version 0.35

    Immune Systems:
     * chmlib version 0.36 and above

    Remote exploitation of a stack overflow vulnerability in chmlib as
    included in various Linux distributions allows attackers to execute
    arbitrary code.

    The vulnerability specifically exists due to an unchecked memory copy
    while processing a CHM file.

    The vulnerability exists in the following code, which is found in
    chm_lib.c:
    static UChar *_chm_find_in_PMGL(UChar *page_buf, Uint32 block_len, const
    char *objPath)
    {
    [...]
      char buffer[CHM_MAX_PATHLEN+1];
        /* figure out where to start and end */
        cur = page_buf;
        hremain = _CHM_PMGL_LEN;
        if (! _unmarshal_pmgl_header(&cur, &hremain, &header))
            return NULL;
        end = page_buf + block_len - (header.free_space);
        
        /* now, scan progressively */
        while (cur < end)
        {
            /* grab the name */
            temp = cur;
            strLen = _chm_parse_cword(&cur);
            if (! _chm_parse_UTF8(&cur, strLen, buffer))
                return NULL;
    [..]

    _chm_parse_cword can be forced to return a value larger than
    CHM_MAX_PATHLEN. This value is then used while copying user controlled
    data into a CHM_MAX_PATHLEN sized stack buffer. This allows the attacker
    full control over execution flow by overwriting the saved return address
    on the stack.

    Exploitation could allow attackers to execute arbitrary code with the
    privileges of the user processing the CHM file. Remote exploitation can be
    achieved by sending a malicious file in an e-mail message to the target
    user.

    CVE Information:
     <http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-2930>
    CAN-2005-2930

    Disclosure Timeline:
    09/08/2005 - Initial vendor notification
    09/09/2005 - Initial vendor response
    10/28/2005 - Public disclosure

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:labs-no-reply@idefense.com>
    iDEFENSE Labs.
    The original article can be found at:
    <http://www.idefense.com/application/poi/display?id=332&type=vulnerabilities> http://www.idefense.com/application/poi/display?id=332&type=vulnerabilities

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

    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] Skype Buffer Overflow"

    Relevant Pages

    • [NEWS] Mozilla Thunderbird MIME External-Body Heap 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 ... Mozilla Thunderbird MIME External-Body Heap Overflow Vulnerability ... Thunderbird could allow an attacker to execute arbitrary code with the ...
      (Securiteam)
    • [UNIX] Sun Microsystems Solaris srsexec Format String 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 ... Sun Microsystems Solaris srsexec Format String Vulnerability ... all of the client machines being monitored and is set-uid root by default. ... attackers to execute arbitrary code with root privileges. ...
      (Securiteam)
    • [UNIX] Multiple UNIX/Linux Vendor Xpdf makeFileKey2 Stack Overflow
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Remote exploitation of a buffer overflow vulnerability in the xpdf PDF ... arbitrary code execution as the user viewing a PDF file. ...
      (Securiteam)
    • [NT] Cisco Call Manager CTLProvider Heap 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 ... Cisco Call Manager CTLProvider Heap Overflow Vulnerability ... This can lead to arbitrary code execution. ... This will continue until heap chunks are overwritten at the users control, ...
      (Securiteam)
    • [NEWS] Macromedia JRun Web Server URL Parsing Buffer Overflow
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Macromedia JRun Web Server URL Parsing Buffer Overflow ... Remote exploitation of a buffer overflow vulnerability in Macromedia JRun ... potentially allowing the execution of arbitrary code. ...
      (Securiteam)