Gentoo Logo

libpng: Execution of arbitrary code


1.  Gentoo Linux Security Advisory

Version Information

Advisory Reference GLSA 200804-15 / libpng
Release Date April 15, 2008
Latest Revision April 15, 2008: 01
Impact high
Exploitable remote
Package Vulnerable versions Unaffected versions Architecture(s)
media-libs/libpng < 1.2.26-r1 >= 1.2.26-r1 All supported architectures

Related bugreports: #217047


A vulnerability in libpng may allow for execution of arbitrary code in certain applications that handle untrusted images.

2.  Impact Information


libpng is a free ANSI C library used to process and manipulate PNG images.


Tavis Ormandy of the Google Security Team discovered that libpng does not handle zero-length unknown chunks in PNG files correctly, which might lead to memory corruption in applications that call png_set_read_user_chunk_fn() or png_set_keep_unknown_chunks().


A remote attacker could entice a user or automated system to process a specially crafted PNG image in an application using libpng and possibly execute arbitrary code with the privileges of the user running the application. Note that processing of unknown chunks is disabled by default in most PNG applications, but some such as ImageMagick are affected.

3.  Resolution Information


There is no known workaround at this time.


All libpng users should upgrade to the latest version:

Code Listing 3.1: Resolution

# emerge --sync
# emerge --ask --oneshot --verbose ">=media-libs/libpng-1.2.26-r1"

4.  References


Page updated April 15, 2008

Summary: This is a Gentoo Linux Security Advisory

Security Team
Contact Address

Donate to support our development efforts.

Copyright 2001-2015 Gentoo Foundation, Inc. Questions, Comments? Contact us.