CVE-2021-21706: ZipArchive::extractTo may extract outside of destination dir
Vulnerability summary
CVE-2021-21706 is a medium (CVSS 6.5) Path Traversal: '../filedir' vulnerability in php group php. EPSS estimates a 1.52% chance of exploitation in the next 30 days, higher than 75.4% of scored vulnerabilities.
Not severe (CVSS 5.3, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 4 · Related 4Timeline
- 04-10-2021PublishedVulnerability first disclosed.
- 16-09-2024Last modifiedVulnerability information updated.
Description
In PHP versions 7.3.x below 7.3.31, 7.4.x below 7.4.24 and 8.0.x below 8.0.11, in Microsoft Windows environment, ZipArchive::extractTo may be tricked into writing a file outside target directory when extracting a ZIP file, thus potentially causing files to be created or overwritten, subject to OS permissions.
CVSS metrics
5 scores · 4 sources · 2 versions- CVE.orgCNA5.3MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:NDiffers
- OSV · UbuntuEcosystem advisory · calculated5.3MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:NDiffers
- OSV · AlpineEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
EPSS trend
Probability
1.52%
Chance of exploitation in the next 30 days
Percentile
75%
Versus all other CVEs
30-day change
No change 0.00 pp
From 1.52% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-24Path Traversal: '../filedir'The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "../" sequences that can resolve to a location that is outside of that directory.
- CWE-22Improper Limitation of a Pathname to a Restricted DirectoryThe product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Affected systems
Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.
Alpine3 products
- php7< 7.3.31-r0 | < 7.4.24-r0
- php8< 8.0.11-r0
- php81< 8.1.0_rc3-r0
Php1 product
- php≥ 7.3.0, < 7.3.31 | ≥ 7.4.0, < 7.4.24 | ≥ 8.0.0, < 8.0.11
Php group1 product
- php≥ 7.3.x, < 7.3.31 | ≥ 7.4.x, < 7.4.24 | ≥ 8.0.X, < 8.0.11
Ubuntu1 product
- php8.1< 8.1.0-1
4 vendors · 6 products