CVE-2017-16642 in PHPinfo

Summary

by MITRE

In PHP before 5.6.32, 7.x before 7.0.25, and 7.1.x before 7.1.11, an error in the date extension's timelib_meridian handling of 'front of' and 'back of' directives could be used by attackers able to supply date strings to leak information from the interpreter, related to ext/date/lib/parse_date.c out-of-bounds reads affecting the php_parse_date function. NOTE: this is a different issue than CVE-2017-11145.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 04/10/2025

The vulnerability identified as CVE-2017-16642 represents a critical information disclosure flaw within PHP's date parsing functionality that affects multiple versions of the PHP interpreter. This vulnerability resides in the date extension's timelib_meridian handling mechanism, specifically within the ext/date/lib/parse_date.c file where the php_parse_date function processes date strings. The flaw manifests when the interpreter encounters date strings containing 'front of' and 'back of' directives, which are used to specify time references relative to specific points in the day. Attackers who can influence date string inputs to the PHP interpreter can exploit this vulnerability to perform out-of-bounds memory reads, potentially extracting sensitive information from the interpreter's memory space. This type of vulnerability falls under the category of information disclosure issues that can be classified as CWE-200, which encompasses weaknesses that allow attackers to gain access to information that should remain hidden.

The technical execution of this vulnerability relies on the improper handling of date parsing directives within the timelib library, which is responsible for parsing date and time strings in PHP applications. When PHP processes date strings containing these specific directives, the internal parsing logic fails to properly validate bounds during memory access operations, leading to out-of-bounds reads. The vulnerability specifically affects the meridian handling code path where the interpreter attempts to parse time references such as "front of noon" or "back of midnight" and subsequently accesses memory locations beyond the allocated buffer boundaries. This memory access pattern can result in the leakage of stack contents, heap data, or other sensitive information that may contain application state, configuration details, or cryptographic keys. The vulnerability demonstrates characteristics consistent with memory safety issues that are often associated with buffer overflows or out-of-bounds access patterns, making it particularly dangerous in environments where sensitive data is processed.

The operational impact of this vulnerability extends beyond simple information disclosure, as the leaked memory contents could potentially reveal critical system information that attackers might leverage for further exploitation. In web applications processing user-supplied date inputs, an attacker could craft malicious date strings to extract memory addresses, application data, or even credentials that might be stored in nearby memory locations. The vulnerability is particularly concerning because it can be exploited through normal date parsing operations without requiring special privileges or complex attack vectors. This makes it a significant risk for web applications that process date inputs from untrusted sources, as the attack surface is broad and the exploitation mechanism is relatively straightforward. The vulnerability affects not only the PHP interpreter itself but also any applications built on top of it, making it a widespread concern across the PHP ecosystem.

Mitigation strategies for CVE-2017-16642 primarily involve upgrading to patched versions of PHP where the date parsing logic has been corrected to properly handle out-of-bounds memory access. Organizations should prioritize updating their PHP installations to versions 5.6.32, 7.0.25, or 7.1.11 respectively, which contain the necessary fixes for this vulnerability. Additionally, implementing input validation and sanitization measures can help reduce the risk of exploitation by filtering or rejecting date strings that contain potentially malicious directive combinations. Security monitoring should include detection of unusual date parsing patterns that might indicate exploitation attempts, and network-based intrusion detection systems can be configured to identify suspicious traffic patterns associated with this vulnerability. The ATT&CK framework categorizes this type of vulnerability under privilege escalation and defense evasion techniques, as it can be used to gather intelligence for more sophisticated attacks. Organizations should also consider implementing application-level firewalls or web application firewalls that can detect and block malicious date string inputs, providing an additional layer of protection against exploitation attempts.

Reservation

11/07/2017

Disclosure

11/07/2017

Moderation

accepted

CPE

ready

Exploit

Download

EPSS

0.08257

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!