oCERT-2008-003 libpng zero-length chunks incorrect handling


Applications using libpng that install unknown chunk handlers, or copy unknown chunks, may be vulnerable to a security issue which may result in incorrect output, information leaks, crashes, or arbitrary code execution.

The issue involves libpng incorrectly handling zero length chunks which results in uninitialized memory affecting the control flow of the application.

Affected version:

libpng >= 1.0.6, <= 1.0.32 & >= 1.2.0, <= 1.2.26 [*]

* - the libpng project indicates that build options PNG_READ_UNKNOWN_CHUNKS_SUPPORTED or PNG_READ_USER_CHUNKS_SUPPORTED (default configuration) are affected.

Fixed version:

libpng >= 1.0.33, >= 1.2.27

Credit: Tavis Ormandy, oCERT Team | Google Security Team

CVE: CVE-2008-1382


2008-04-05: contacted libpng maintainers
2008-04-05: vendor confirms
2008-04-05: verification of vendor suggested patch
2008-04-12: libpng-1.2.27beta01 released
2008-04-12: libpng project advisory released
2008-04-12: advisory release