Keep Track of the Latest Vulnerabilities
with SecurityTracker!
    Home    |    View Topics    |    Search    |    Contact Us    |   


Sign Up
Sign Up for Your FREE Weekly SecurityTracker E-mail Alert Summary
Instant Alerts
Buy our Premium Vulnerability Notification Service to receive customized, instant alerts
Put SecurityTracker Vulnerability Alerts on Your Web Site -- It's Free!
Become a Partner and License Our Database or Notification Service
Report a Bug
Report a vulnerability that you have found to SecurityTracker

Category:   Application (Generic)  >   chmlib Vendors:   Wing, Jed
chmlib Buffer Overflow in *_chm_find_in_PMGL() Lets Remote Users Execute Arbitrary Code
SecurityTracker Alert ID:  1015120
SecurityTracker URL:
CVE Reference:   CVE-2005-2930   (Links to External Site)
Date:  Oct 28 2005
Impact:   Execution of arbitrary code via network, User access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  
Version(s): prior to 0.36
Description:   iDEFENSE reported a vulnerability in chmlib. A remote user can cause arbitrary code to be executed on the target user's system.

The chmlib library contains a buffer overflow in the *_chm_find_in_PMGL() function. A remote user can create a specially crafted CHM file that, when processed by the target user, will execute arbitrary code with the privileges of the target user.

The flaw resides in 'chm_lib.c'.

The vendor was notified on September 8, 2005.

The original advisory is available at:

Impact:   A remote user can create a file that, when processed by the target user, will cause arbitrary code to be executed with the privileges of the target user.
Solution:   The vendor has issued a fixed version (0.36), available at:

Vendor URL: (Links to External Site)
Cause:   Boundary error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)

Message History:   None.

 Source Message Contents

Date:  Fri, 28 Oct 2005 15:56:16 -0400
Subject:  iDefense Security Advisory 10.28.05: Multiple Vendor chmlib CHM File

Multiple Vendor chmlib CHM File Handling Buffer Overflow Vulnerability

iDefense Security Advisory 10.28.05
October 28, 2005


chmlib is a library for dealing with Microsoft ITSS/CHM format files.


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,
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.


iDefense has confirmed the existence of this vulnerability in chmlib 
0.35. It is suspected that all versions of chmlib are vulnerable. 

The following vendors distribute susceptible chmlib packages within 
their respective operating system distributions:

	FreeBSD Project:
	  FreeBSD 5.4 and prior
	Gentoo Foundation Inc.:
	  Gentoo Linux 1.1a, 1.2, 1.4, 2004.0, 2004.1 and 2004.2 


Do not open CHM files sent from an untrusted source.


chmlib-0.36 addresses this vulnerability and is available for download


The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-2930 to this issue. This is a candidate for inclusion in
the CVE list (, which standardizes names for
security problems.


09/08/2005  Initial vendor notification
09/09/2005  Initial vendor response
10/28/2005  Public disclosure


The discoverer of this vulnerability wishes to remain anonymous.

Get paid for vulnerability research

Free tools, research and upcoming events


Copyright (c) 2005 iDefense, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

Go to the Top of This SecurityTracker Archive Page

Home   |    View Topics   |    Search   |    Contact Us

Copyright 2017, LLC