Pillowで細工した画像の保存時にヒープ領域を破壊されコード実行のおそれ
Summary
Pillow の JPEG 保存処理で、ICC プロファイルがエンコーダのバッファをちょうど埋めた場合に、COM コメントの書き込みでヒープ領域が上書きされる脆弱性です。影響を受けるのは 9.4.0 から 13.0.0 未満の Pillow で、クラッシュやコード実行のおそれがあります。13.0.0 以降に更新してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
Pillow の JPEG 保存処理で、ICC プロファイルがエンコーダのバッファをちょうど埋めた場合に、COM コメントの書き込みでヒープ領域が上書きされる脆弱性です。影響を受けるのは 9.4.0 から 13.0.0 未満の Pillow で、クラッシュやコード実行のおそれがあります。13.0.0 以降に更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| python-pillowPillow | — | Not listed |
| pipPillow |
< 13.0.0→ 13.0.0 |
13.0.0 |
| PyPIpillow |
≥ 9.4.0, < 13.0.0→ 13.0.0 |
13.0.0 |
| Bitnamipillow |
≥ 9.4.0, < 13.0.0→ 13.0.0 |
13.0.0 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Debian DEBIAN-CVE-2026-96778 pillow Fix available
- Ubuntu UBUNTU-CVE-2026-96778 pillow Fix available
Original description The description as published by the source.
Pillow is a Python imaging library. From 9.4.0 until 13.0.0, ImagingJpegEncode() in src/libImaging/JpegEncode.c can call jpeg_write_marker() for a JPEG COM comment when an ICC profile has exactly filled the 65536-byte encoder buffer. libjpeg writes one byte before checking the exhausted free_in_buffer counter, which then wraps and permits the attacker-controlled comment and subsequent compressed image data to overwrite adjacent heap memory. Re-saving an untrusted image as JPEG while preserving its ICC profile and forwarded comment can crash the process and may enable code execution in suitable runtime and heap layouts. This issue is fixed in version 13.0.0.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- patch github.com
- patch github.com
- REDHAT Red Hat
- web github.com
- web github.com