{"id":"CVE-2025-48071","aliases":["CVE-2025-48071","GHSA-h45x-qhg2-q375","PYSEC-2026-1747"],"related":[],"kind":"vulnerability","state":"published","title":"OpenEXR's Forged Unpacked Size can Lead to Heap-Based Buffer Overflow in Deep Scanline Parsing","summary":"OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. In versions 3.3.2 through 3.3.0, there is a heap-based buffer overflow during a write operation when decompressing ZIPS-packed deep scan-line EXR files with a maliciously forged chunk header. This is fixed in version 3.3.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture industry. In versions 3.3.2 through 3.3.0, there is a heap-based buffer overflow during a write operation when decompressing ZIPS-packed deep scan-line EXR files with a maliciously forged chunk header. This is fixed in version 3.3.3.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe OpenEXRCore code is vulnerable to a heap-based buffer overflow during a write operation when decompressing ZIPS-packed deep scan-line EXR files with a maliciously forged chunk header.\n\n### Details\nWhen parsing `STORAGE_DEEP_SCANLINE` chunks from an EXR file, the following code (from `src/lib/OpenEXRCore/chunk.c`) is used to extract the chunk information:\n\n```cpp\n\nif (part->storage_mode == EXR_STORAGE_DEEP_SCANLINE)\n// SNIP...\n        cinfo->sample_count_data_offset = dataoff;\n        cinfo->sample_count_table_size  = (uint64_t) ddata[0];\n        cinfo->data_offset              = dataoff + (uint64_t) ddata[0];\n        cinfo->packed_size              = (uint64_t) ddata[1];\n        cinfo->unpacked_size            = (uint64_t) ddata[2];\n// SNIP...\n```\n\nBy storing this information, the code that will later decompress and reconstruct the chunk bytes, will know how much space the uncompressed data will occupy.\n\nThis size is carried along in the chain of decoding/decompression until the `undo_zip_impl` function in `src/lib/OpenEXRCore/internal_zip.c`:\n\n```cpp\nstatic exr_result_t\nundo_zip_impl (\n    exr_decode_pipeline_t* decode,\n    const void*            compressed_data,\n    uint64_t               comp_buf_size,\n    void*                  uncompressed_data,\n    uint64_t               uncompressed_size,\n    void*                  scratch_data,\n    uint64_t               scratch_size)\n{\n    size_t       actual_out_bytes;\n    exr_result_t res;\n\n    if (scratch_size < uncompressed_size) return EXR_ERR_INVALID_ARGUMENT;\n\n    res = exr_uncompress_buffer (\n        decode->context,\n        compressed_data,\n        comp_buf_size,\n        scratch_data,\n        scratch_size,\n        &actual_out_bytes);\n\n    if (res == EXR_ERR_SUCCESS)\n    {\n        decode->bytes_decompressed = actual_out_bytes;\n        if (comp_buf_size > actual_out_bytes)\n            res = EXR_ERR_CORRUPT_CHUNK;\n        else\n            internal_zip_reconstruct_bytes (\n                uncompressed_data, scratch_data, actual_out_bytes);\n    }\n\n    return res;\n}\n```\n\nThe `uncompressed_size` comes from the `unpacked_size` extracted earlier, and the `uncompressed_data` is a buffer allocated by making space for the size \"advertised\" in the chunk information.\n\nHowever, `scratch_data` and `actual_out_bytes` will contain, after decompression, the uncompressed data and its size, respectively. \n\nThe vulnerability lies in the fact that the `undo_zip_impl` function lacks code to check whether `actual_out_bytes` is greater than `uncompressed_size`. \n\nThe effect is that, by setting the `unpacked_size` in the chunk header smaller than the actual chunk decompressed data, it is possible - in the `internal_zip_reconstruct_bytes` function - to overflow past the boundaries of a heap chunk.\n\n### PoC\n\nNOTE: you can download the `heap_overflow.exr` file from this link:\n\nhttps://github.com/ShielderSec/poc/tree/main/CVE-2025-48071\n\n1. Compile the `exrcheck` binary in a macOS or GNU/Linux machine with ASAN.\n2. Open the `heap_overflow.exr` file with the following command:\n\n```\nexrcheck heap_overflow.exr\n```\n\n3. Notice that `exrcheck` crashes with an ASAN stack-trace.\n![image](https://github.com/user-attachments/assets/57907073-bc9f-40bb-9030-16008035ade8)\n\n### Impact\n\nAn attacker might exploit this vulnerability by feeding a maliciously crafted file to a program that uses the OpenEXR libraries, thus gaining the capability to write an arbitrary amount of bytes in the heap. This could potentially result in code execution in the process.","format":"markdown","source":"ghsa"},{"lang":"es","text":"OpenEXR proporciona la especificación y la implementación de referencia del formato de archivo EXR, un formato de almacenamiento de imágenes para la industria cinematográfica. En las versiones 3.3.2 a 3.3.0, se produce un desbordamiento de búfer en el montón durante una operación de escritura al descomprimir archivos EXR de línea de escaneo profundo comprimidos en ZIPS con un encabezado de fragmento falsificado maliciosamente. Esto se solucionó en la versión 3.3.3.","source":"nvd"}],"published":"2025-07-31T19:12:56.000Z","modified":"2026-07-07T17:56:54.703Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}],"cwes":["CWE-122"],"affected":[{"ranges":[{"version":">= 3.3.0, < 3.3.3","status":"affected"}],"vendor":"AcademySoftwareFoundation","product":"openexr","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.3.0","status":"affected","fixed":"3.3.3"}],"ecosystem":"PyPI","package":"openexr","purl":"pkg:pypi/openexr","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.3.0","fixed":"3.3.3"}],"vendor":"openexr","product":"openexr","cpe":"cpe:2.3:a:openexr:openexr:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"3.3.0","status":"affected","fixed":"3.3.3"}],"ecosystem":"PyPI","package":"openexr","purl":"pkg:pypi/openexr","source":"pysec"}],"references":[{"url":"https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-h45x-qhg2-q375","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/AcademySoftwareFoundation/openexr/commit/916cc729e24aa16b86d82813f6e136340ab2876f","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/AcademySoftwareFoundation/openexr/releases/tag/v3.3.3","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-48071","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/AcademySoftwareFoundation/openexr","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/ShielderSec/poc/tree/main/CVE-2025-48071","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/openexr","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-h45x-qhg2-q375","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-07-31T20:22:12.430Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-48071","url":"https://www.cve.org/CVERecord?id=CVE-2025-48071","licence":"CVE Terms of Use","modified":"2025-07-31T20:22:23.603Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h45x-qhg2-q375","url":"https://github.com/advisories/GHSA-h45x-qhg2-q375","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:54.703Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-48071","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-48071","licence":"Public domain","modified":"2026-06-17T09:29:06.320Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1747","url":"https://osv.dev/vulnerability/PYSEC-2026-1747","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:08.255Z"}],"updatedAt":"2026-11-25T22:59:01.950Z","epss":{"score":0.00396,"percentile":0.25374,"date":"2026-11-30T12:00:22.000Z"}}