HighCVE-2026-96637

    Python-pillow Pillow: Improper Handling of Highly Compressed Data (Data Amplification) (CVE-2026-96637)

    Published Last modified Sources: CVE.org, Hersteller

    What is affected, what to do

    Update Python-pillow Pillow to version 13.0.0.

    Affected
    • Python-pillow Pillow lt *..13.0.0
    Fixed in
    • Python-pillow Pillow 13.0.0

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    7.1

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: Vendor (CNA), CVSS v4

    7.1

    CVSS v4

    Severity High on the scale from 0 to 10.

    Source: CVE.org, Hersteller

    —

    EPSS score

    No value is available for this vulnerability.

    Show all metrics
    Severity
    High
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    65.50 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    no public PoC known
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    7.1 Methodology
    CVSS v4

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    7.1
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    —
    Published
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-400, CWE-409

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    High technical severity: assess and remediate the vulnerability in vulnerability handling under Art. 21(2)(e) NIS2 and document the decision.
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    Summary

    SpiderImagePlugin's seek() bypasses the decompression bomb check, allowing a tiny (<1KB) crafted SPIDER stack file to trigger a multi-gigabyte allocation on im.load().

    Affected versions

    All versions up to and including current HEAD (v13.0.0.dev0, commit e7a7ea84)

    Root cause

    Image.open() runs Image._decompression_bomb_check(im.size) exactly once, in _open_core (src/PIL/Image.py:3668), right after the initial _open().

    SPIDER stack files are multi-frame: SpiderImageFile.seek(frame) (SpiderImagePlugin.py:179-190) computes an attacker-influenced stkoffset and calls self._open() AGAIN directly (line 190) — NOT through Image.open(). _open() re-parses a fresh 27-float header at that offset and reassigns:

    self._size = int(h[12]), int(h[2])      # SpiderImagePlugin.py:131
    

    straight from unvalidated header floats (isSpiderHeader only checks internal labrec*lenbyt==labbyt consistency, never bounds nsam/nrow). No bomb check runs on this new size.

    On the subsequent load(), ImageFile.load_prepare() (ImageFile.py:436-437) executes self.im = Image.core.new(self.mode, self.size) with the unchecked, attacker-chosen size. Mode is always "F" (4 bytes/pixel), so e.g. 40000x40000 = 6.4 GB.

    Why this is a real bug

    Sibling multi-frame plugins DO re-check on their alternate paths:

    • GifImagePlugin.py:286 - Image._decompression_bomb_check(self._size) (in seek)
    • TiffImagePlugin.py:1309 - Image._decompression_bomb_check(self._tile_size)
    • IcnsImagePlugin.py:121/138, IcoImagePlugin.py:236/240 (sub-image selection)

    SpiderImagePlugin has NO bomb check anywhere. This is the same class of bug just fixed for GdImageFile (GHSA-phj9-mv4w-65pm) and the FontFile classes (GHSA-5x94/8v84/45hq): an allocation reached on a non-Image.open() path sized by an attacker header field, independent of the one-time pixel bomb check.

    Reproduction

    Python 3.13, Pillow HEAD e7a7ea84

    Attached: pillow_poc_spider_bomb.py

    Sets Image.MAX_IMAGE_PIXELS=5000, then:

    • CONTROL: Image.open(standalone 100x100 SPIDER) -> DecompressionBombWarning fires correctly.
    • BYPASS: Image.open(stack, frame0=1x1) passes; im.seek(1) sets size (100,100) with NO DecompressionBombWarning/Error -> the check is bypassed.

    Real-world impact: a large frame-1 nsam/nrow (e.g. 40000x40000) causes im.load() to allocate ~6.4 GB (mode F) with the bomb check fully bypassed, from a file under 1 KB.

    Suggested fix

    Call Image._decompression_bomb_check(self.size) at the end of SpiderImageFile._open() (or in seek() after _open()), mirroring GifImagePlugin / TiffImagePlugin. Optionally validate nsam/nrow are positive and sane in _open().

    Credit: Yazan Balawneh - CyStack Security Team pillow_poc_spider_bomb.py

    Source: NVD (NIST), cvelistv5, GitHub Security Advisories

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    VendorProductAffected versionsFixed in
    python-pillowPillow
    • < 13.0.0
    • 13.0.0
    pippillow
    • < 13.0.0
    • 13.0.0

    Weakness classes (CWE)

    • CWE-400Uncontrolled Resource Consumption

      Class

      The product does not properly control the allocation and maintenance of a limited resource.

      Entry at MITRE CWE-400
    • CWE-409Improper Handling of Highly Compressed Data (Data Amplification)

      Base

      The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.

      Entry at MITRE CWE-409

    References & sources

    • github.compython-pillow/Pillow/security/advisories/GHSA-g842-9rc4-69pwx_refsource_CONFIRM
    • github.compython-pillow/Pillow/pull/10076x_refsource_MISC
    • github.compython-pillow/Pillow/commit/7cb0e02389d8aac2a60896a490f572db0b0…x_refsource_MISC
    • github.compython-pillow/Pillow/releases/tag/13.0.0x_refsource_MISC

    Reanalysis & status changes

    Chronological NVD audit events for this CVE — reanalyses, CVSS updates, CPE diffs.

    1. New CVE Receivedsecurity-advisories@github.com

      • Description: after Pillow is a Python imaging library. Prior to 13.0.0, SpiderImageFile.seek() in src/PIL/SpiderImagePlugin.py reparses a later SPIDER stack frame and replaces self._size without rerunning Image._decompression_bomb_check(). A tiny file can use a safe first frame to pass Image.open() and then declare very large dimensions in a later mode F frame. Loading that frame allocates approximately four bytes per attacker-declared pixel and can consume multiple gigabytes of memory. This issue is fixed in version 13.0.0.
      • CVSS V4.0: after AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
      • CWE: after CWE-400
      • CWE: after CWE-409
    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2026-96637
    <a href="https://intel.neosec.eu/en/cve/CVE-2026-96637"><img src="https://intel.neosec.eu/badge/cve/CVE-2026-96637.svg?lang=en" alt="CVE-2026-96637 – NEOSEC Intel" height="20"></a>