Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. Pillow
  4. ›
  5. CVE-2026-112895

CVE-2026-112895: Pillow: Unbounded recursion parsing a PDF page tree or trailer chain (incomplete fix for CVE-2026-42310)

October 20, 2026

When an application appends to an existing PDF with Image.save(..., format="PDF", append=True), Pillow parses that file with PdfParser. Two recursive parsers have no effective bound. linearize_page_tree follows /Kids with no visited set or depth limit, so a cyclic or duplicated page tree recurses without end. read_prev_trailer rejects only an exactly repeated /Prev offset, so a long chain of unique offsets still recurses. The trailer-loop guard added for CVE-2026-42310 does not cover either case.

References

  • github.com/advisories/GHSA-p4wg-p73j-c528
  • github.com/python-pillow/Pillow/commit/e2ae7eacad6de68c37eb28b633a97bebacf2c5bf
  • github.com/python-pillow/Pillow/releases/tag/13.0.0
  • github.com/python-pillow/Pillow/security/advisories/GHSA-p4wg-p73j-c528
  • nvd.nist.gov/vuln/detail/CVE-2026-112895

Code Behaviors & Features

Detect and mitigate CVE-2026-112895 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 5.1.0 before 13.0.0

Fixed versions

  • 13.0.0

Solution

Upgrade to version 13.0.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-674: Uncontrolled Recursion

Source file

pypi/Pillow/CVE-2026-112895.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 21 Oct 2026 12:16:17 +0000.