CVE-2021-27921: Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the reported size of a contained image is not…
Noroxi assessment
Priority: Monitor (action score 31/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 3.1% (FIRST EPSS); higher than 88.2% of all records.
- Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: python3-pillow (AlmaLinux:8) 5.1.1-16.el8; py3-pillow (Alpine:v3.14) 8.1.2-r0; pillow (Debian:12) 8.1.2-1.
Low priority for now. Upgrade to python3-pillow (AlmaLinux:8) 5.1.1-16.el8; py3-pillow (Alpine:v3.14) 8.1.2-r0; pillow (Debian:12) 8.1.2-1 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the reported size of a contained image is not properly checked for a BLP container, and thus an attempted memory allocation can be very large.
- Published
- Mar 3, 2021
- Updated
- Jun 16, 2026
- EPSS
- 3.1% · 88th percentile
- CWE
- CWE-20
Report tools
Action score
31
Low priority for now.
- CVSS
- 30 / 40 · 7.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 3.1%
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| python | pillow | cpe:2.3:a:python:pillow |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- fedoraproject fedora32
- fedoraproject fedora33
- fedoraproject fedora34
- python pillowbefore 8.1.1
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | python3-pillow | before 5.1.1-16.el8 | 5.1.1-16.el8 |
| Alpine:v3.14 | py3-pillow | before 8.1.2-r0 | 8.1.2-r0 |
| Debian:12 | pillow | before 8.1.2-1 | 8.1.2-1 |
| openSUSE:Leap 15.2 | python-CairoSVG | before 2.5.1-lp152.2.3.1 | 2.5.1-lp152.2.3.1 |
| openSUSE:Leap 15.2 | python-Pillow | before 8.3.1-lp152.5.3.1 | 8.3.1-lp152.5.3.1 |
| openSUSE:Leap 15.5 | python-Pillow | before 7.2.0-150300.3.15.1 | 7.2.0-150300.3.15.1 |
| openSUSE:Tumbleweed | python-Pillow | before 8.3.2-1.2 | 8.3.2-1.2 |
| openSUSE:Tumbleweed | python-Pillow | before 10.3.0-1.1 | 10.3.0-1.1 |
| openSUSE:Tumbleweed | python-Pillow | before 12.3.0-1.1 | 12.3.0-1.1 |
| PyPI | pillow | before 8.1.2 | 8.1.2 |
| PyPI | pillow | before 8.1.1 | 8.1.1 |
| Red Hat:enterprise_linux:8::appstream | python-pillow | before 0:5.1.1-16.el8 | 0:5.1.1-16.el8 |
| Red Hat:enterprise_linux:8::appstream | python-pillow-debuginfo | before 0:5.1.1-16.el8 | 0:5.1.1-16.el8 |
| Red Hat:enterprise_linux:8::appstream | python-pillow-debugsource | before 0:5.1.1-16.el8 | 0:5.1.1-16.el8 |
| Red Hat:enterprise_linux:8::appstream | python3-pillow | before 0:5.1.1-16.el8 | 0:5.1.1-16.el8 |
| Red Hat:enterprise_linux:8::appstream | python3-pillow-debuginfo | before 0:5.1.1-16.el8 | 0:5.1.1-16.el8 |
| Red Hat:enterprise_linux:8::appstream | python3-pillow-tk-debuginfo | before 0:5.1.1-16.el8 | 0:5.1.1-16.el8 |
| Rocky Linux:8 | python-pillow | before 0:5.1.1-16.el8 | 0:5.1.1-16.el8 |
| SUSE:Linux Enterprise Module for Package Hub 15 SP6 | python-Pillow | before 7.2.0-150300.3.15.1 | 7.2.0-150300.3.15.1 |
| SUSE:OpenStack Cloud 9 | python-Pillow | before 5.2.0-3.8.1 | 5.2.0-3.8.1 |
Same product
python: all recordsOther highest-scoring records for the same primary product.
- CVE-2014-3007Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands via shell…43Plan
- CVE-2016-4009Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote attackers to have…41Plan
- CVE-2022-30595libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files.40Plan
Published before and after this one in the same product
- ← EarlierCVE-2020-35654Jan 12, 2021 · In Pillow before 8.1.0, TiffDecode has a heap-based buffer overflow when decoding crafted YCbCr files because of certain interpretation…36Monitor
- ← EarlierCVE-2020-35655Jan 12, 2021 · In Pillow before 8.1.0, SGIRleDecode has a 4-byte buffer over-read when decoding crafted SGI RLE image files because offsets and length…21Monitor
- Later →CVE-2021-27922Mar 3, 2021 · Pillow before 8.1.2 allows attackers to cause a denial of service (memory consumption) because the reported size of a contained image is…31Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| almalinux:python3-pillow | 5.1.1-16.el8 · AlmaLinux:8 | Package registry (OSV) |
| alpine:py3-pillow | 8.1.2-r0 · Alpine:v3.14 | Package registry (OSV) |
| debian:pillow | 8.1.2-1 · Debian:12 | Package registry (OSV) |
| opensuse:python-CairoSVG | 2.5.1-lp152.2.3.1 · openSUSE:Leap 15.2 | Package registry (OSV) |
| opensuse:python-Pillow | 7.2.0-150300.3.15.1 · openSUSE:Leap 15.5 | Package registry (OSV) |
| PyPI:pillow | 8.1.1 | Package registry (OSV) |
| PyPI:pillow | 8.1.2 | Package registry (OSV) |
| red hat:python-pillow | 0:5.1.1-16.el8 · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:python-pillow-debuginfo | 0:5.1.1-16.el8 · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:python-pillow-debugsource | 0:5.1.1-16.el8 · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:python3-pillow | 0:5.1.1-16.el8 · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:python3-pillow-debuginfo | 0:5.1.1-16.el8 · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:python3-pillow-tk-debuginfo | 0:5.1.1-16.el8 · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| rocky linux:python-pillow | 0:5.1.1-16.el8 · Rocky Linux:8 | Package registry (OSV) |
| suse:python-Pillow | 5.2.0-3.8.1 · SUSE:OpenStack Cloud 9 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- none
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- None
- Availability impact
- High
Weakness class (CWE)
CWE-20 · Improper Input ValidationCVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
nvd-primary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Buffer Overflow via Environment VariablesCAPEC-10likelihood: High · High
- Server Side Include (SSI) InjectionCAPEC-101likelihood: High · High
- Cross Zone ScriptingCAPEC-104likelihood: Medium · High
- Command Line Execution through SQL InjectionCAPEC-108likelihood: Low · Very High
- Object Relational Mapping InjectionCAPEC-109likelihood: Low · High
- SQL Injection through SOAP Parameter TamperingCAPEC-110likelihood: High · Very High
- Double EncodingCAPEC-120likelihood: Low · Medium
- Subverting Environment Variable ValuesCAPEC-13likelihood: High · Very High
ATT&CK techniques
- Obfuscated Files or InformationT1027
- Masquerading: Invalid Code SignatureT1036.001
- Steal Web Session CookieT1539
- Subvert Trust Controls: Code SigningT1553.002
- Impair Defenses:Impair Command History LoggingT1562.003
- Hijack Execution Flow:Dynamic Linker HijackingT1574.006
- Hijack Execution Flow:Path Interception by PATH Environment VariableT1574.007
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (8 more)Show less
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TQQY6472RX4J2SUJENWDZAWKTJJGP2ML/
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZTSY25UJU7NJUFHH3HWT575LT4TDFWBZ/
- pillow.readthedocs.io/en/stable/releasenotes/8.1.2.html
- security.gentoo.org/glsa/202107-33
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/S7G44Z33J4BNI2DPDROHWGVG2U7ZH5JU/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TQQY6472RX4J2SUJENWDZAWKTJJGP2ML/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZTSY25UJU7NJUFHH3HWT575LT4TDFWBZ/
- pillow.readthedocs.io/en/stable/releasenotes/8.1.1.html
Vendor advisories and official records. Exploit/PoC links are deliberately left out.