copyright
|
disclaimer
|
privacy
|
contact
HOME
About
AusCERT
Membership
Contact Us
PKI Services
Training
Publications
Sec. Bulletins
Conferences
News & Media
Services
Web Log
Site Map
Site Help
Member login
Login »
Become a member »
Home
»
Security Bul...
»
By Operating...
»
UNIX (all)
»
Solaris
» ESB-2004.0816 -- iDEFENSE Security Advisories 12.21....
ESB-2004.0816 -- iDEFENSE Security Advisories 12.21.04 -- Two integer overflow vulnerabilities in libtiff
Date:
23 December 2004
References
:
ESB-2005.0037
Click here for printable version
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =========================================================================== AUSCERT External Security Bulletin Redistribution ESB-2004.0816 -- iDEFENSE Security Advisories 12.21.04 Two integer overflow vulnerabilities in libtiff 23 December 2004 =========================================================================== AusCERT Security Bulletin Summary --------------------------------- Product: libtiff 3.7.0 and prior Publisher: iDEFENSE Operating System: UNIX variants Linux variants Impact: Execute Arbitrary Code/Commands Access: Remote/Unauthenticated Original Bulletin: http://www.idefense.com/application/poi/display?id=173 http://www.idefense.com/application/poi/display?id=174 Comment: This bulletin contains two separate iDEFENSE advisories describing vulnerabilities in libtiff. - --------------------------BEGIN INCLUDED TEXT-------------------- iDEFENSE Security Advisory 12.21.04: I. BACKGROUND libtiff provides support for the Tag Image File Format (TIFF), a widely used format for storing image data. More information is available at the following site: http://www.remotesensing.org/libtiff/ II. DESCRIPTION Remote exploitation of an integer overflow in libtiff may allow for the execution of arbitrary code. The overflow occurs in the parsing of TIFF files set with the STRIPOFFSETS flag in libtiff/tif_dirread.c. In the TIFFFetchStripThing() function, the number of strips (nstrips) is used directly in a CheckMalloc() routine without sanity checking. The call ultimately boils down to: malloc(user_supplied_int*size(int32)); When supplied 0x40000000 as the user supplied integer, malloc is called with a length argument of 0. This has the effect of returning the smallest possible malloc chunk. A user controlled buffer is subsequently copied to that small heap buffer, causing a heap overflow. When exploited, it is possible to overwrite heap structures and seize control of execution. III. ANALYSIS An attacker can exploit the above-described vulnerability to execute arbitrary code under the permissions of the target user. Successful exploitation requires that the attacker convince the end user to open the malicious TIFF file using an application linked with a vulnerable version of libtiff. Exploitation of this vulnerability against a remote target is difficult because of the precision required in the attack. IV. DETECTION iDEFENSE has confirmed this vulnerability in libtiff 3.6.1. Changes were introduced in libtiff 3.7.0 that had the effect of fixing this vulnerability. The following vendors provide susceptible libtiff packages within their respective operating system distributions: - Gentoo Linux - Fedora Linux - RedHat Linux - SuSE Linux - Debian Linux V. WORKAROUND Only open TIFF files from trusted users. VI. VENDOR RESPONSE This issue is addressed in libtiff 3.7.0 and 3.7.1. VII. CVE INFORMATION A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not been assigned yet. VIII. DISCLOSURE TIMELINE 12/15/2004 Discovery of fix in later software version 12/21/2004 Public disclosure IX. CREDIT infamous41md[at]hotpop.com is credited with this discovery. Get paid for vulnerability research http://www.idefense.com/poi/teams/vcp.jsp X. LEGAL NOTICES Copyright © 2004 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 customerservice@idefense.com 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. - --------------------------------------------------------------------------- libtiff Directory Entry Count Integer Overflow Vulnerability iDEFENSE Security Advisory 12.21.04: I. BACKGROUND This software provides support for the Tag Image File Format (TIFF), a widely used format for storing image data. Included in this software distribution is a library, libtiff, for reading and writing TIFF, a small collection of tools for doing simple manipulations of TIFF images on UNIX systems, and documentation on the library and tools. A small assortment of TIFF-related software for UNIX that has been contributed by others is also included. More information is available at the following site: http://www.remotesensing.org/libtiff/ II. DESCRIPTION Remote exploitation of a heap-based buffer overflow vulnerability within the LibTIFF package could allow attackers to execute arbitrary code. The vulnerability specifically exists due to insufficient validation of user-supplied data when calculating the size of a directory entry. A TIFF file includes a number of directory entry header fields that describe the data in the file. Included in these entries is an entry count and offset value that are calculated to determine the size and location of the data for that entry. If the directory entry type is TIFF_ASCII or TIFF_UNDEFINED, the a call to CheckMalloc is made in order to allocate space for the entry contents as shown below from tif_dirread.c: cp = CheckMalloc(tif, dp->tdir_count+1, 1, mesg); if( (ok = (cp && TIFFFetchString(tif, dp, cp))) != 0 ) cp[dp->tdir_count] = '\0'; /* XXX */ If the tdir_count is set to 0xffffffff, the increment will cause the function call to allocate 0 bytes of memory and later memcpy calls will cause the buffer to overflow. An attacker may generate a malicious TIFF file which takes advantage of this unchecked calculation to execute arbitrary code with permissions of the user opening the TIFF file. III. ANALYSIS Remote attackers may be able to execute arbitrary code with permissions of the user opening the malformed TIFF file. The exposure to this vulnerability is mitigated by the fact that user interaction is required and that the user must view the malicious TIFF file in an application that is linked to a vulnerable version of libtiff. IV. DETECTION iDEFENSE has confirmed the existence of this vulnerability in LibTIFF 3.5.7 and 3.7.0. The following vendors distribute susceptible TIFF packages within their respective operating system distributions: - Debian Linux - Gentoo Linux - RedHat Linux - SuSE Linux V. WORKAROUND Only open TIFF files from trusted users or in an application not linked against vulnerable versions of libtiff. VI. VENDOR RESPONSE The following patch will address this vulnerability: - --- tif_dirread.c.bak 2004-12-19 21:04:00.000000000 +0300 +++ tif_dirread.c 2004-12-19 21:04:03.000000000 +0300 @@ -71,7 +71,7 @@ /* * XXX: Check for integer overflow. */ - - if (elem_size && bytes / elem_size == nmemb) + if (nmemb && elem_size && bytes / elem_size == nmemb) cp = (char*)_TIFFmalloc(bytes); if (cp == NULL) (the same applies for tif_fax3.c) This patch has been incorporated into libtiff 3.7.1. VII. CVE INFORMATION A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not been assigned yet. VIII. DISCLOSURE TIMELINE 12/17/2004 Initial vendor notification 12/17/2004 iDEFENSE clients notified 12/21/2004 Coordinated public disclosure IX. CREDIT infamous41md[at]hotpop.com is credited with this discovery. Get paid for vulnerability research http://www.idefense.com/poi/teams/vcp.jsp X. LEGAL NOTICES Copyright © 2004 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 customerservice@idefense.com 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. - --------------------------END INCLUDED TEXT-------------------- You have received this e-mail bulletin as a result of your organisation's registration with AusCERT. The mailing list you are subscribed to is maintained within your organisation, so if you do not wish to continue receiving these bulletins you should contact your local IT manager. If you do not know who that is, please send an email to auscert@auscert.org.au and we will forward your request to the appropriate person. NOTE: Third Party Rights This security bulletin is provided as a service to AusCERT's members. As AusCERT did not write the document quoted above, AusCERT has had no control over its content. The decision to follow or act on information or advice contained in this security bulletin is the responsibility of each user or organisation, and should be considered in accordance with your organisation's site policies and procedures. AusCERT takes no responsibility for consequences which may arise from following or acting on information or advice contained in this security bulletin. NOTE: This is only the original release of the security bulletin. It may not be updated when updates to the original are made. If downloading at a later date, it is recommended that the bulletin is retrieved directly from the author's website to ensure that the information is still current. Contact information for the authors of the original document is included in the Security Bulletin above. If you have any questions or need further information, please contact them directly. Previous advisories and external security bulletins can be retrieved from: http://www.auscert.org.au/render.html?cid=1980 If you believe that your computer system has been compromised or attacked in any way, we encourage you to let us know by completing the secure National IT Incident Reporting Form at: http://www.auscert.org.au/render.html?it=3192 =========================================================================== Australian Computer Emergency Response Team The University of Queensland Brisbane Qld 4072 Internet Email: auscert@auscert.org.au Facsimile: (07) 3365 7031 Telephone: (07) 3365 4417 (International: +61 7 3365 4417) AusCERT personnel answer during Queensland business hours which are GMT+10:00 (AEST). On call after hours for member emergencies only. =========================================================================== -----BEGIN PGP SIGNATURE----- Comment: http://www.auscert.org.au/render.html?it=1967 iQCVAwUBQcoSDSh9+71yA2DNAQKD5gQAgFLHzg3pxjLtV9nsEv91fpJ7pNnBAxMc zMTrhIxWD2A9ZCAJCsn4++cTMxYdeLmPG7R9Ia/RBrrpx85k4G4+L/c5MD8pGPKc lNmTLXbFKWMuWPvDqH8DfmN46EdPbEuxMbl21jZhTSsyl/Gs3oRK264u+ui3NIyj Qs/vmvXnLpM= =ySYT -----END PGP SIGNATURE-----
Comments? Click here
http://www.auscert.org.au/render.html?cid=33&it=4659