Pillow image library can be crashed or hijacked by a crafted JPEG 2000 file
Pillow is a popular Python library for opening images. A specially crafted JPEG 2000 image can corrupt memory while Pillow loads it, which can crash the program or possibly let an attacker run their own code.
| Severity | HighCVSS 8.1 of 10 |
|---|---|
| Being exploited? | UnclearNo reports either way yet |
| Fix available? | Yespillow 13.0.0 · since 25 Oct 2026 |
| How sure is this? | Official sourceBacked by an official source |
How the attack works simplified
- 1Crafted imageAttacker builds a malicious JPEG 2000 file
- 2Upload or downloadFile reaches your app as normal input
- 3Pillow loads itImage.open and load parse the file
- 4Memory overwrittenHeap buffer overflow write in OpenJPEG
- 5Crash or takeoverProgram crashes or attacker gains control
- ResultAttacker may crash or control the process
What happened
The bundled OpenJPEG library inside Pillow wheels 11.1.0 through 12.3.0 has a heap-buffer-overflow write in opj_j2k_read_sod, reached via an unchecked TPsot index when a valid TLM marker is combined with TNsot=0. The fix exists on OpenJPEG master but no OpenJPEG release includes it.
Are you affected?
You are affected if you use Pillow 11.1.0 up to but not including 13.0.0 (wheels bundling OpenJPEG 2.5.3 or 2.5.4) and open JPEG 2000 images from untrusted sources.
| Package / product | Affected versions | Fixed in |
|---|---|---|
| pillow · pip | >= 11.1.0, < 13.0.0 | 13.0.0 |
What to do
- Upgrade Pillow to 13.0.0 or later
- If you cannot upgrade yet, do not open untrusted JPEG 2000 (.jp2/.j2k) images with Pillow
- Check your installed version with: pip show pillow
Timeline
- 22 Oct 2026, 17:01 UTCPublicly disclosed
- 22 Oct 2026, 17:01 UTCReported by GitHub Advisory · GitHub Advisory
Sources 1 report, oldest first
Official vendor, government CERT or advisory database
- GitHub Advisory22 Oct 2026, 17:01 UTC
Technical details
- ID
- GHSA-78g4-xqwv-q3g8
- CVSS
- 8.1 / 10
- Disclosed
- 22 Oct 2026, 17:01 UTC
- On Zero Radar
- before the radar started
- Last change
- 25 Oct 2026, 13:32 UTC
The plain-language parts and the attack diagram were written by an AI model (anthropic/claude-haiku-5.5) from the sources above. Facts like versions, exploitation and dates come from the sources themselves. How Zero Radar works