CVE-2017-11145 in PHPinfo

Summary

by MITRE

In PHP before 5.6.31, 7.x before 7.0.21, and 7.1.x before 7.1.7, lack of a bounds check in the date extension's timelib_meridian parsing code could be used by attackers able to supply date strings to leak information from the interpreter, related to an ext/date/lib/parse_date.c out-of-bounds read affecting the php_parse_date function.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 12/12/2022

The vulnerability identified as CVE-2017-11145 represents a critical out-of-bounds read flaw within PHP's date parsing functionality that affects multiple versions of the PHP interpreter. This issue resides in the timelib_meridian parsing code within the date extension, specifically within the ext/date/lib/parse_date.c file. The vulnerability manifests when the php_parse_date function processes date strings that contain meridian indicators such as am/pm, creating a scenario where memory access occurs beyond the allocated buffer boundaries. This flaw falls under the CWE-125 vulnerability category, which specifically addresses out-of-bounds read conditions that can lead to information disclosure and potential exploitation.

The technical implementation of this vulnerability exploits a missing bounds check in the parsing logic that handles time meridian values. When PHP processes date strings containing meridian indicators, the parser fails to validate that the index used to access the meridian data remains within valid memory boundaries. This oversight allows attackers to craft specially formatted date strings that trigger memory access violations, potentially leading to information leakage from the interpreter's memory space. The vulnerability is particularly concerning because it can be triggered through user-supplied input, making it exploitable in web applications where date parsing is utilized. According to ATT&CK framework, this represents a technique categorized under T1059.007 for scripting and T1566 for malicious file execution through web applications.

The operational impact of CVE-2017-11145 extends beyond simple information disclosure, as it provides attackers with potential access to sensitive memory contents that could include stack contents, heap data, or other interpreter-related information. This information leakage could be leveraged by attackers to facilitate more sophisticated attacks such as heap spraying, stack pivoting, or bypassing security mechanisms like stack canaries. The vulnerability affects PHP versions prior to 5.6.31, 7.0.21, and 7.1.7, representing a substantial portion of widely deployed PHP installations. Organizations running these vulnerable versions face significant risk, particularly in environments where date parsing is frequently used in user input handling, form processing, or API endpoints that accept date-time data.

Mitigation strategies for this vulnerability require immediate patching of affected PHP installations to versions that contain the necessary bounds checking implementations. System administrators should prioritize updating their PHP environments and verify that all date parsing functions are properly secured. Additionally, input validation should be implemented at application layers to sanitize date strings before they are processed by PHP's date functions. Security monitoring should be enhanced to detect unusual patterns in date string processing that might indicate exploitation attempts. The fix implemented in patched versions addresses the core issue by introducing proper bounds checking mechanisms within the timelib_meridian parsing code, ensuring that all memory accesses remain within allocated buffer boundaries. Organizations should also consider implementing web application firewalls and input sanitization measures to provide additional defense-in-depth against potential exploitation attempts targeting this vulnerability.

Reservation

07/10/2017

Disclosure

07/10/2017

Moderation

accepted

CPE

ready

EPSS

0.07713

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!