CVE-2026-42310pillow Loop with Unreachable Exit Condition (Infinite Loop)
NVD
Vulnerability Summary
### Impact
An attacker can supply a malicious PDF that causes the process to hang indefinitely, consuming 100% CPU and making the application unresponsive.
### Patches
Patched version: 12.2.0.
PdfParser (introduced in Pillow 4.2.0) follows Prev pointers in PDF trailers to read cross-reference sections. If a
trailer's Prev pointer references an offset that has already been processed — either pointing to itself or forming a
longer cycle — the parser enters an infinite loop. Pillow now tracks previously processed trailer offsets and raises an
error if a cycle is detected.
### Workarounds
Use any version but the affected versions: >= 4.2.0, < 12.2.0
### Resources
- Fix: https://github.com/python-pillow/Pillow/pull/9519
An attacker can supply a malicious PDF that causes the process to hang indefinitely, consuming 100% CPU and making the application unresponsive.
### Patches
Patched version: 12.2.0.
PdfParser (introduced in Pillow 4.2.0) follows Prev pointers in PDF trailers to read cross-reference sections. If a
trailer's Prev pointer references an offset that has already been processed — either pointing to itself or forming a
longer cycle — the parser enters an infinite loop. Pillow now tracks previously processed trailer offsets and raises an
error if a cycle is detected.
### Workarounds
Use any version but the affected versions: >= 4.2.0, < 12.2.0
### Resources
- Fix: https://github.com/python-pillow/Pillow/pull/9519
CVSS v4.0 Base Metrics — Score 5.1
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NAttack VectorLocal
Attack ComplexityLow
Attack RequirementsNone
Privileges RequiredNone
User InteractionNone
Confidentiality (Vulnerable System)None
Integrity (Vulnerable System)None
Availability (Vulnerable System)Low
Confidentiality (Subsequent System)None
Integrity (Subsequent System)None
Availability (Subsequent System)None
Show CVSS v3.x metrics (score 5.5)
CVSS v3.1 Base Metrics — Score 5.5
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HAttack VectorLocal
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeUnchanged
ConfidentialityNone
IntegrityNone
AvailabilityHigh
Affected & Patched Versions
- pillow >= 4.2.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
Fix it during your normal patch cycle. No exploitation is confirmed yet.
- 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-42310. 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-r73j-pqj5-w3x7
- Patchhttps://github.com/python-pillow/Pillow/pull/9519
- CVE Recordhttps://nvd.nist.gov/vuln/detail/CVE-2026-42310
- Patchhttps://github.com/python-pillow/Pillow/commit/3bf614e4b8615d0ce1d5039efaf6db447fe7c468
- Referencehttps://github.com/python-pillow/Pillow/releases/tag/12.2.0
- Referencehttps://github.com/advisories/GHSA-r73j-pqj5-w3x7
Data last checked: Sep 23, 2026 13:58 UTC