CVE-2013-6420: Buffer Overflow
Stefan Esser reported a vulnerability in the PHP openssl extension. A memory corruption flaw was found in the way the opensslx509parse() function of the PHP openssl extension parsed X.509 certificates. A remote attacker could use this flaw to provide a malicious self-signed certificate or a certificate signed by a trusted authority to a PHP application using the aforementioned function, causing the application to crash or, possibly, allow the attacker to execute arbitrary code with the privileges of the user running the PHP interpreter.
Acknowledgements:
Red Hat would like to thank the PHP project for reporting this issue. Upstream acknowledges Stefan Esser as the original reporter of this issue.
Other sources
The asn1timetotimet function in ext/openssl/openssl.c in PHP before 5.3.28, 5.4.x before 5.4.23, and 5.5.x before 5.5.7 does not properly parse (1) notBefore and (2) notAfter timestamps in X.509 certificates, which allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via a crafted certificate that is not properly handled by the opensslx509parse function.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.5.7 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.4.23 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.3.28
Event History
Frequently Asked Questions
What is the severity of CVE-2013-6420?
CVE-2013-6420 has been classified as a high severity vulnerability due to the potential for remote code execution via crafted X.509 certificates.
How do I fix CVE-2013-6420?
To fix CVE-2013-6420, upgrade your PHP installation to version 5.5.7 or later for 5.5.x, 5.4.23 or later for 5.4.x, or 5.3.28 or later for 5.3.x.
What versions of PHP are affected by CVE-2013-6420?
CVE-2013-6420 affects PHP versions 5.3.0 to 5.3.27, 5.4.0 to 5.4.22, and 5.5.0 to 5.5.6.
Can CVE-2013-6420 be exploited remotely?
Yes, CVE-2013-6420 can be exploited by remote attackers through the use of crafted self-signed X.509 certificates.
Is there a workaround for CVE-2013-6420?
There is no effective workaround for CVE-2013-6420; the best mitigation is to update to a patched version of PHP.