CVE-2020-7063

Public Exploit
Files added to tar with Phar::buildFromIterator have all-access permissions

Description

In PHP versions 7.2.x below 7.2.28, 7.3.x below 7.3.15 and 7.4.x below 7.4.3, when creating PHAR archive using PharData::buildFromIterator() function, the files are added with default permissions (0666, or all access) even if the original files on the filesystem were with more restrictive permissions. This may result in files having more lax permissions than intended when such archive is extracted.

Remediation

Workaround:

  • Use different Phar class functions to compose the archive, such as addFile(), or reset file permissions upon extracting files from the archive.

Category

5.5
CVSS
Severity: Medium
CVSS 3.1 •
CVSS 2.0 •
EPSS 0.30%
Vendor Advisory opensuse.org Vendor Advisory gentoo.org Vendor Advisory ubuntu.com Vendor Advisory debian.org Vendor Advisory debian.org Vendor Advisory php.net
Affected: PHP Group PHP
Published at:
Updated at:

References

Link Tags
https://bugs.php.net/bug.php?id=79082 vendor advisory exploit
http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00023.html third party advisory vendor advisory
https://security.gentoo.org/glsa/202003-57 third party advisory vendor advisory
https://lists.debian.org/debian-lts-announce/2020/03/msg00034.html third party advisory mailing list
https://usn.ubuntu.com/4330-1/ third party advisory vendor advisory
https://www.debian.org/security/2020/dsa-4717 third party advisory vendor advisory
https://www.debian.org/security/2020/dsa-4719 third party advisory vendor advisory
https://www.tenable.com/security/tns-2021-14 third party advisory patch

Frequently Asked Questions

What is the severity of CVE-2020-7063?
CVE-2020-7063 has been scored as a medium severity vulnerability.
How to fix CVE-2020-7063?
As a workaround for remediating CVE-2020-7063: Use different Phar class functions to compose the archive, such as addFile(), or reset file permissions upon extracting files from the archive.
Is CVE-2020-7063 being actively exploited in the wild?
It is possible that CVE-2020-7063 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2020-7063?
CVE-2020-7063 affects PHP Group PHP.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.