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

- Severity: Medium 5.3 (CVSS:3.1, scored by php) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.52%, higher than 75% of CVEs (2026-12-01)
- Published: 2021-10-04T04:00:17.182Z
- Modified: 2026-09-08T08:48:18.261Z
- Also known as: BIT-LIBPHP-2021-21706, BIT-PHP-2021-21706, BIT-PHP-MIN-2021-21706
- Weaknesses: CWE-22, CWE-24
- Assigned by: php

## 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.

(As written by CVE List.)

## Affected

- PHP Group PHP: from 7.3.x before 7.3.31; from 7.4.x before 7.4.24; from 8.0.X before 8.0.11
- php php: from 7.3.0 before 7.3.31; from 7.4.0 before 7.4.24; from 8.0.0 before 8.0.11
- libphp (Bitnami): from 7.3.0 before 7.3.31; from 7.4.0 before 7.4.24; from 8.0.0 before 8.0.11
- php (Bitnami): from 7.3.0 before 7.3.31; from 7.4.0 before 7.4.24; from 8.0.0 before 8.0.11
- php-min (Bitnami): from 7.3.0 before 7.3.31; from 7.4.0 before 7.4.24; from 8.0.0 before 8.0.11

## Every score

- php: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://bugs.php.net/bug.php?id=81420> (advisory, issue-tracking, patch, vendor-advisory)
- <https://security.netapp.com/advisory/ntap-20211029-0007/> (advisory, third-party-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21706> (web)

## Sources

- CVE List: [CVE-2021-21706](https://www.cve.org/CVERecord?id=CVE-2021-21706), CVE Terms of Use, modified 2024-09-16
- NVD: [CVE-2021-21706](https://nvd.nist.gov/vuln/detail/CVE-2021-21706), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-LIBPHP-2021-21706](https://osv.dev/vulnerability/BIT-LIBPHP-2021-21706), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PHP-2021-21706](https://osv.dev/vulnerability/BIT-PHP-2021-21706), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PHP-MIN-2021-21706](https://osv.dev/vulnerability/BIT-PHP-MIN-2021-21706), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-21706 · Whole record: https://cve.day/CVE-2021-21706.json · Rebuilt by cve.day 2026-11-25T22:58:04.264Z
