CVE Vulnerabilities

CVE-2004-0421

Out-of-bounds Read

Published: Aug 18, 2004 | Modified: Feb 09, 2024
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
5 MEDIUM
AV:N/AC:L/Au:N/C:N/I:N/A:P
RedHat/V2
RedHat/V3
Ubuntu
UNTRIAGED

The Portable Network Graphics library (libpng) 1.0.15 and earlier allows attackers to cause a denial of service (crash) via a malformed PNG image file that triggers an error that causes an out-of-bounds read when creating the error message.

Weakness

The product reads data past the end, or before the beginning, of the intended buffer.

Affected Software

Name Vendor Start Version End Version
Libpng Libpng 1.0.0 (including) 1.0.0 (including)
Libpng Libpng 1.0.5 (including) 1.0.5 (including)
Libpng Libpng 1.0.6 (including) 1.0.6 (including)
Libpng Libpng 1.0.7 (including) 1.0.7 (including)
Libpng Libpng 1.0.8 (including) 1.0.8 (including)
Libpng Libpng 1.0.9 (including) 1.0.9 (including)
Libpng Libpng 1.0.10 (including) 1.0.10 (including)
Libpng Libpng 1.0.11 (including) 1.0.11 (including)
Libpng Libpng 1.0.12 (including) 1.0.12 (including)
Libpng Libpng 1.0.13 (including) 1.0.13 (including)
Libpng Libpng 1.0.14 (including) 1.0.14 (including)
Libpng Libpng 1.2.0 (including) 1.2.0 (including)
Libpng Libpng 1.2.1 (including) 1.2.1 (including)
Libpng Libpng 1.2.2 (including) 1.2.2 (including)
Libpng Libpng 1.2.3 (including) 1.2.3 (including)
Libpng Libpng 1.2.4 (including) 1.2.4 (including)
Libpng Libpng 1.2.5 (including) 1.2.5 (including)
Openpkg Openpkg 1.3 (including) 1.3 (including)
Openpkg Openpkg 2.0 (including) 2.0 (including)
Libpng Redhat 1.2.2-16 (including) 1.2.2-16 (including)
Libpng Redhat 1.2.2-20 (including) 1.2.2-20 (including)
Red Hat Enterprise Linux 3 RedHat libpng-2:1.2.2-21 *
Red Hat Enterprise Linux 3 RedHat libpng10-0:1.0.13-12 *
Red Hat Linux 9 RedHat *
Libpng Ubuntu dapper *
Libpng Ubuntu devel *
Libpng Ubuntu edgy *
Libpng Ubuntu feisty *
Libpng3 Ubuntu dapper *
Libpng3 Ubuntu edgy *

Potential Mitigations

  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • To reduce the likelihood of introducing an out-of-bounds read, ensure that you validate and ensure correct calculations for any length argument, buffer size calculation, or offset. Be especially careful of relying on a sentinel (i.e. special character such as NUL) in untrusted inputs.

References