Path traversal in PHP

Published: 2021-09-29 | Updated: 2021-09-30
Risk Medium
Patch available YES
Number of vulnerabilities 1
CVE-ID CVE-2021-21706
Exploitation vector Network
Public exploit N/A
Vulnerable software
Universal components / Libraries / Scripting languages

Vendor PHP Group

Security Bulletin

This security bulletin contains one medium risk vulnerability.

1) Absolute Path Traversal

EUVDB-ID: #VU56905

Risk: Medium

CVSSv3.1: 6.4 [CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N/E:U/RL:O/RC:C]

CVE-ID: CVE-2021-21706

CWE-ID: CWE-36 - Absolute Path Traversal

Exploit availability: No


The vulnerability allows a remote attacker overwrite files on the system.

The vulnerability exists due to insufficient filtration of file names in the php_zip_make_relative_path() function on Windows systems. A remote attacker can construct a specially crafted ZIP archive, which once extracted by the ZipArchive::extractTo() function, can overwrite files outside of the destination directory.

Successful exploitation of the vulnerability may allow an attacker to overwrite arbitrary files on the system with privileges of the web server, but requires that the web application is running on Windows.


Install updates from vendor's website.

Vulnerable software versions

PHP: 7.3 - 8.0.10

External links

Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability.