CVE-2026-42311pillow Integer Overflow or Wraparound
NVD
Vulnerability Summary
### Impact
Processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution.
### Patches
Patched version: 12.2.0
Pillow 12.1.1 addressed CVE-2026-25990 by adding checks for tile extents in PSD image decoding/encoding to prevent an out-of-bounds write. However, the bounds checks computed tile extent sums using types susceptible to integer overflow, meaning a PSD image with carefully chosen tile dimensions could produce values that wrap around and bypass the checks, still triggering an out-of-bounds write in src/decode.c and src/encode.c. The fix avoids adding extents together before comparison.
### Workarounds
Use any version but affected versions: >= 10.3.0, < 12.2.0
### Resources
- Fix: https://github.com/python-pillow/Pillow/pull/9520
- Original issue: CVE-2026-25990 (Pillow 12.1.1)
Processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution.
### Patches
Patched version: 12.2.0
Pillow 12.1.1 addressed CVE-2026-25990 by adding checks for tile extents in PSD image decoding/encoding to prevent an out-of-bounds write. However, the bounds checks computed tile extent sums using types susceptible to integer overflow, meaning a PSD image with carefully chosen tile dimensions could produce values that wrap around and bypass the checks, still triggering an out-of-bounds write in src/decode.c and src/encode.c. The fix avoids adding extents together before comparison.
### Workarounds
Use any version but affected versions: >= 10.3.0, < 12.2.0
### Resources
- Fix: https://github.com/python-pillow/Pillow/pull/9520
- Original issue: CVE-2026-25990 (Pillow 12.1.1)
CVSS v4.0 Base Metrics — Score 8.6
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NAttack VectorLocal
Attack ComplexityLow
Attack RequirementsNone
Privileges RequiredNone
User InteractionNone
Confidentiality (Vulnerable System)High
Integrity (Vulnerable System)High
Availability (Vulnerable System)High
Confidentiality (Subsequent System)None
Integrity (Subsequent System)None
Availability (Subsequent System)None
Affected & Patched Versions
- pillow >= 10.3.0, < 12.2.0
No patched version published yet
Until a fix ships, reduce exposure:
- Restrict access to the affected service or interface to trusted networks.
- Disable the affected feature if you do not need it.
- Watch the vendor advisory for a firmware or software update.
What to do
Plan remediation soon. No exploitation is confirmed yet, but the severity is high.
- Check whether you run pillow and which version.
- No patched version is listed yet. Limit access to the affected service to trusted networks, and disable the feature if you can.
- Subscribe to the vendor advisory so you learn when a fix ships.
Timeline
- May 4, 2026Published
- May 13, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new pillow CVEsYou are reading CVE-2026-42311. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
- Vendor Advisoryhttps://github.com/python-pillow/Pillow/security/advisories/GHSA-cfh3-3jmp-rvhc
- Vendor Advisoryhttps://github.com/python-pillow/Pillow/security/advisories/GHSA-pwv6-vv43-88gr
- Patchhttps://github.com/python-pillow/Pillow/pull/9520
- CVE Recordhttps://nvd.nist.gov/vuln/detail/CVE-2026-42311
- Patchhttps://github.com/python-pillow/Pillow/commit/58f9a1d166dcb0c274807d4423522d205b0c35ea
- Referencehttps://github.com/python-pillow/Pillow/releases/tag/12.2.0
- Referencehttps://github.com/advisories/GHSA-pwv6-vv43-88gr
Data last checked: Sep 23, 2026 13:58 UTC