# CVE-2021-21706: ZipArchive::extractTo may extract outside of destination dir

- Priority: **Routine**
- Reason: Not severe (CVSS 5.3, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2021-10-04 · Modified: 2024-09-16
- Aliases: UBUNTU-CVE-2021-21706, ALPINE-CVE-2021-21706
- Record: https://cvemate.com/vulnerability/CVE-2021-21706 · JSON: https://cvemate.com/vulnerability/CVE-2021-21706/json

## Description

```text
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.
```

## Signals

- CVSS: 6.5 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
- EPSS: 1.517%, percentile 75.42%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine php7 (Alpine Linux): \< 7.3.31-r0 \| \< 7.4.24-r0
- alpine php8 (Alpine Linux): \< 8.0.11-r0
- alpine php81 (Alpine Linux): \< 8.1.0\_rc3-r0
- ubuntu php8.1 (Ubuntu): \< 8.1.0-1
- php group php: ≥ 7.3.x, \< 7.3.31 \| ≥ 7.4.x, \< 7.4.24 \| ≥ 8.0.X, \< 8.0.11
- php php: ≥ 7.3.0, \< 7.3.31 \| ≥ 7.4.0, \< 7.4.24 \| ≥ 8.0.0, \< 8.0.11

## References

- <https://bugs.php.net/bug.php?id=81420>
- <https://security.netapp.com/advisory/ntap-20211029-0007/>
- <https://ubuntu.com/security/CVE-2021-21706>
- <https://www.cve.org/CVERecord?id=CVE-2021-21706>
- <https://security.alpinelinux.org/vuln/CVE-2021-21706>

---

Data as of 2026-12-05T10:02:05.922Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
