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

Published Oct 4, 2021
·
Updated

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.

Other sources

Fixed bug (ZipArchive::extractTo extracts outside of destination) (CVE-2021-21706).

PHP

Affected Software

5 affected componentsFixes available
PHP PHP<8.1.0
8.1.0
PHP PHP>=7.3.0<7.3.31
PHP PHP>=7.4.0<7.4.24
PHP PHP>=8.0.0<8.0.11
Microsoft Windows

Remediation

Event History

Oct 4, 2021
CVE Published
via MITRE·04:00 AM
Data Sourced
via MITRE·04:00 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the vulnerability ID of this bug?

The vulnerability ID of this bug is CVE-2021-21706.

2

What is the title of this bug?

The title of this bug is Fixed bug (ZipArchive::extractTo extracts outside of destination) (CVE-2021-21706).

3

What is the severity of CVE-2021-21706?

The severity of CVE-2021-21706 is medium.

4

Which versions of PHP are affected by CVE-2021-21706?

PHP versions 7.3.x below 7.3.31, 7.4.x below 7.4.24, and 8.0.x below 8.0.11 are affected by CVE-2021-21706.

5

How can CVE-2021-21706 be exploited?

In a Microsoft Windows environment, an attacker can trick ZipArchive::extractTo into writing a file outside the target directory when extracting a ZIP file.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203