Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-112899
Published:October 20, 2026
Updated:October 21, 2026
When an application opens an untrusted Encapsulated PostScript file and asks Pillow to render it at a larger scale, Pillow has Ghostscript produce an image several times bigger than Pillow's configured size limit allows. The size check runs only after Ghostscript has finished rendering and written the full raw image to a temporary file. An attacker who can upload a file of about 100 bytes makes each such request spend scale² times the Ghostscript rendering work and temporary disk space that the limit is meant to permit. For example, at scale 2 that is a 972 MB temporary file. The cause is in "Ghostscript()" in "src/PIL/EpsImagePlugin.py". It multiplies the file-declared size by the caller's "scale" (lines 93-94) and passes the product to "gs" as the "-g" output geometry. It never calls "Image._decompression_bomb_check()" on the scaled size. The only check is the one "Image.open()" ran on the unscaled size, so a file declaring 9000×9000 passes, and "load(scale=2)" then asks Ghostscript for 18000×18000 (3.6× "MAX_IMAGE_PIXELS"). A file declaring 18000×18000 directly would be refused before Ghostscript ever ran. "DecompressionBombError" fires only when Pillow reopens the output file, so Pillow's own in-process allocation stays bounded and there is no memory corruption. The effect is a constant-factor overshoot rather than an unbounded one, for three reasons: * The multiplier is an integer chosen by the application, not by the file. * With the default warning filter, "Image.open()" already lets files up to 2× the limit reach Ghostscript at "scale=1". * Any application feeding untrusted files to Ghostscript is already exposed to a tiny file that keeps Ghostscript busy indefinitely, since "gs" runs with no timeout. This is the EPS counterpart of the WMF "load(dpi)" gap closed in af70b075a. It has been present since the decompression-bomb limit was introduced in ce2955ec7 (2.5.0). The attached reproducer stubs out Ghostscript and shows a 76-byte file passing "Image.open()" and reaching "gs" with "-g18000x18000". A one-line patch mirroring the WMF check is included.
Affected Packages
pillow (CONDA):
Affected version(s) >=12.0.0 <13.0.0
Fix Suggestion:
Update to version 13.0.0
https://github.com/python-pillow/Pillow.git (GITHUB):
Affected version(s) >=12.0.0 <13.0.0
Fix Suggestion:
Update to version 13.0.0
pillow (PYTHON):
Affected version(s) >=12.0.0 <13.0.0
Fix Suggestion:
Update to version 13.0.0
Do you need more information?
Contact Us
CVSS v4
Base Score:
6.9
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
NONE
Vulnerable System Integrity
NONE
Vulnerable System Availability
LOW
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
5.3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
LOW
Weakness Type (CWE)
Allocation of Resources Without Limits or Throttling