# CVE-2004-0597: Memory corruption in n/a

> Remote attackers can execute arbitrary code by tricking users into opening malformed PNG images processed by vulnerable libpng versions.

- **Severity:** Critical 10.0 (`AV:N/AC:L/Au:N/C:C/I:C/A:C`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 5 Aug 2004
- **Updated:** 8 Aug 2024
- **Also known as:** CVE-2004-0954, GHSA-pjf2-ggxp-rg8p

## What is CVE-2004-0597?

CVE-2004-0597 is a critical memory corruption vulnerability in Microsoft Windows 98se, published on 5 Aug 2004. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Multiple buffer overflows in libpng 1.2.5 and earlier, as used in multiple products, allow remote attackers to execute arbitrary code via malformed PNG images in which (1) the png_handle_tRNS function does not properly validate the length of transparency chunk (tRNS) data, or the (2) png_handle_sBIT or (3) png_handle_hIST functions do not perform sufficient bounds checking.

## Which versions are affected by CVE-2004-0597?

It affects 6 products.


Products: Greg Roelofs Libpng, Microsoft Msn Messenger, Microsoft Windows 98se, Microsoft Windows Me, Microsoft Windows Media Player, Microsoft Windows Messenger.

## How do I fix CVE-2004-0597?

Upgrade to a fixed version.

## Is CVE-2004-0597 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2004-0597 exists.

Public exploit code:

- LibPNG Graphics Library - Remote Buffer Overflow (exploitdb)
- LibPNG 1.2.5 - 'png_jmpbuf()' Local Buffer Overflow (exploitdb)
- Microsoft MSN Messenger 6.2.0137 - '.png' Remote Buffer Overflow (exploitdb)

## Other vulnerabilities in Microsoft Windows 98se

- [CVE-2006-3334](https://insights.sbomify.com/CVE-2006-3334/): Memory corruption in n/a (high 7.5)
- [CVE-2002-1363](https://insights.sbomify.com/CVE-2002-1363/): Memory corruption in n/a (high 7.5)
- [CVE-2002-0660](https://insights.sbomify.com/CVE-2002-0660/): Memory corruption in n/a (high 7.5)
- [CVE-2006-0481](https://insights.sbomify.com/CVE-2006-0481/): Memory corruption in n/a (medium 5.0)
- [CVE-2004-0598](https://insights.sbomify.com/CVE-2004-0598/): Null dereference in n/a (medium 5.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2004-0597 and fix it if it is affected.

What it is: CVE-2004-0597 is a critical memory corruption vulnerability in Microsoft Windows 98se, published on 5 Aug 2004. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2004-0597 exists.

Affected product: Microsoft Windows 98se. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2004-0597/ (Markdown: https://insights.sbomify.com/CVE-2004-0597/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2004-0597
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2004-0597
- OSV: https://osv.dev/vulnerability/CVE-2004-0597

---
From sbomify Insights: https://insights.sbomify.com/CVE-2004-0597/
Summaries are generated and may contain mistakes; the official description above is the record.
