CVE-2022-24303: Path traversal in Pillow
9.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.64813%
CWE
Published
3/11/2022
Updated
10/11/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
Pillow | pip | < 9.0.1 | 9.0.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper handling of temporary paths containing spaces in multiple ImageShow viewer classes. The pre-patch implementations used shell commands (with 'rm -f $im' patterns) and tempfile.mkstemp
without proper path quoting. This allowed attackers to manipulate temporary filenames with spaces to delete arbitrary files. The commit 427221e
explicitly replaces these vulnerable shell-based removal patterns with os.remove
and subprocess
calls without shell=True, confirming these functions were the source of the path traversal vulnerability. The high confidence comes from direct correlation between the patch changes and CVE description of space mishandling in temporary paths.