CVE-2021-21706
ZipArchive::extractTo may extract outside of destination dir
Reported by php · Published October 4, 2021
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| php-min | Bitnami | 8.0.11, 7.4.24, 7.3.31 |
| php7 | Alpine | 7.4.24-r0, 7.3.31-r0 |
| libphp | Bitnami | 8.0.11, 7.4.24, 7.3.31 |
| php8 | Alpine | 8.0.11-r0 |
| php81 | Alpine | 8.1.0_rc3-r0 |
| php | Bitnami | 8.0.11, 7.4.24, 7.3.31 |
| php | Bitnami | 8.0.11, 7.4.24, 7.3.31 |
| libphp | Bitnami | 8.0.11, 7.4.24, 7.3.31 |
| php | php | 8.0.11, 7.4.24, 7.3.31 |
| php8.1 | Ubuntu:22.04:LTS | 8.1.0-1 |
| PHP | PHP Group | 8.0.11, 7.4.24, 7.3.31 |
| php-min | Bitnami | 8.0.11, 7.4.24, 7.3.31 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| PHP Group | PHP | 7.3.x, 7.4.x, 8.0.X |
| arch | php | 8.0.10-1 |
| alpine | php7 | 0, 0 |
| alpine | php8 | 0 |
| PHP Group | PHP | 8.0.X, 7.3.x, 7.4.x |
| alpine | php81 | 0 |
Timeline
- Sep 24, 2021 CVE Published
- Oct 4, 2021 EPSS Score (30 in total, the first dated here)
- Nov 21, 2024 CVE Updated
- Jun 2, 2026 Security Advisory
- Aug 26, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-21706
vulnetix vdb fixes CVE-2021-21706
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-21706/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart