# CVE-2023-5841: OpenEXR Heap Overflow in Scanline Deep Data Parsing

> A heap-based buffer overflow in OpenEXR allows attackers to execute arbitrary code or cause denial of service via malicious deep scanline data.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Feb 2024
- **Updated:** 4 Nov 2025
- **Also known as:** ALSA-2024:8800, ALSA-2024:9548, AZL-62324, CLSA-2025-1749743322, DEBIAN-CVE-2023-5841, GHSA-gxmr-rxpv-c8fq, JLSEC-2026-133, OESA-2024-1215, OESA-2024-1216, OESA-2024-1217, OESA-2024-1218, RHSA-2024:8800, RHSA-2024:8801, RHSA-2024:8802, RHSA-2024:9548, RLSA-2024:8800, RLSA-2024:9548, ROOT-OS-DEBIAN-12-CVE-2023-5841, UBUNTU-CVE-2023-5841, openSUSE-SU-2024:13683-1

## What is CVE-2023-5841?

CVE-2023-5841 is a critical memory corruption vulnerability in Openexr Openexr, published on 1 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Due to a failure in validating the number of scanline samples of a OpenEXR file containing deep scanline data, Academy Software Foundation OpenEX image parsing library version 3.2.1 and prior is susceptible to a heap-based buffer overflow vulnerability. This issue was resolved as of versions v3.2.2 and v3.1.12 of the affected library.

Weakness: CWE-787 (Out-of-bounds Write), CWE-122 (Heap-based Buffer Overflow)

## Which versions are affected by CVE-2023-5841?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openexr` | AlmaLinux:9 | All versions | 3.1.1-2.el9_4.1 |
| `openexr` | AlmaLinux:9 | All versions | 3.1.1-2.el9_5.1 |
| `openexr-devel` | AlmaLinux:9 | All versions | 3.1.1-2.el9_4.1 |
| `openexr-devel` | AlmaLinux:9 | All versions | 3.1.1-2.el9_5.1 |
| `openexr-libs` | AlmaLinux:9 | All versions | 3.1.1-2.el9_4.1 |
| `openexr-libs` | AlmaLinux:9 | All versions | 3.1.1-2.el9_5.1 |
| `openexr` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-libs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-libs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-libs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-libs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-devel` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-devel` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr-libs-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr-libs-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.1.1-2.el9_5.1 |
| `openexr` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.1.1-2.el9_0.1 |
| `openexr-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.1.1-2.el9_0.1 |
| `openexr-debugsource` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.1.1-2.el9_0.1 |
| `openexr-libs` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.1.1-2.el9_0.1 |
| `openexr-libs-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.1.1-2.el9_0.1 |
| `openexr` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-debuginfo` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-debugsource` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-libs` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-libs-debuginfo` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-debuginfo` | Red Hat:rhel_eus:9.2::crb | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-debugsource` | Red Hat:rhel_eus:9.2::crb | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-devel` | Red Hat:rhel_eus:9.2::crb | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr-libs-debuginfo` | Red Hat:rhel_eus:9.2::crb | All versions | 0:3.1.1-2.el9_2.1 |
| `openexr` | Rocky Linux:9 | All versions | 0:3.1.1-2.el9_4.1 |
| `openexr` | Rocky Linux:9 | All versions | 0:3.1.1-2.el9_4.1 |

Products: Openexr Openexr.

## How do I fix CVE-2023-5841?

Upgrade to a fixed version.

## Is CVE-2023-5841 being exploited?

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

## Other vulnerabilities in Openexr Openexr

- [CVE-2026-41142](https://insights.sbomify.com/CVE-2026-41142/): OpenEXR is Vulnerable to Integer overflow in ImageChannel::resize leads to heap OOB write via OpenEXRUtil public API (high 8.8)
- [CVE-2026-42216](https://insights.sbomify.com/CVE-2026-42216/): OpenEXR: Out-of-bounds read in `IDManifest::init()` during prefix expansion (high 8.8)
- [CVE-2017-9111](https://insights.sbomify.com/CVE-2017-9111/): OpenEXR invalid write (high 8.8)
- [CVE-2017-9113](https://insights.sbomify.com/CVE-2017-9113/): Memory corruption in n/a (high 8.8)
- [CVE-2017-9115](https://insights.sbomify.com/CVE-2017-9115/): Memory corruption in n/a (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-5841 and fix it if it is affected.

What it is: CVE-2023-5841 is a critical memory corruption vulnerability in Openexr Openexr, published on 1 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-5841 exists.

Affected product: Openexr Openexr. 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-2023-5841/ (Markdown: https://insights.sbomify.com/CVE-2023-5841/index.md)
```

## Sources

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

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