CVE-2018-5712 in Secure Backupinfo

Summary

by MITRE

An issue was discovered in PHP before 5.6.33, 7.0.x before 7.0.27, 7.1.x before 7.1.13, and 7.2.x before 7.2.1. There is Reflected XSS on the PHAR 404 error page via the URI of a request for a .phar file.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 05/08/2025

The vulnerability identified as CVE-2018-5712 represents a reflected cross-site scripting flaw within PHP's handling of phar file requests, specifically affecting versions prior to the mentioned secure releases. This issue manifests when a user attempts to access a non-existent phar file, triggering a 404 error page that improperly processes and reflects the URI parameter without adequate sanitization. The flaw exists in the HTTP request processing logic where the system fails to properly escape or validate user-supplied input before incorporating it into the error response, creating an avenue for malicious actors to inject arbitrary JavaScript code that executes in the context of other users' browsers.

The technical implementation of this vulnerability stems from PHP's inadequate input validation mechanisms during phar file resolution. When a request is made for a non-existent .phar file, the server generates a 404 error page that includes the requested URI as part of the error message. The system does not perform proper HTML escaping or input sanitization on this URI data before rendering it in the response, allowing attackers to craft malicious URIs containing script tags or other XSS payloads. This creates a classic reflected XSS scenario where the malicious code is reflected back to the user's browser through the vulnerable error page, bypassing normal security measures that might otherwise prevent such attacks.

The operational impact of this vulnerability extends beyond simple script execution as it can enable attackers to perform various malicious activities including session hijacking, credential theft, data exfiltration, and redirection to malicious sites. An attacker could craft a specially formatted URI containing a payload designed to steal session cookies or redirect users to phishing pages that appear legitimate. The vulnerability affects all PHP versions before the specified patches, making it particularly concerning for organizations with legacy systems or those unable to immediately upgrade their PHP installations. The reflected nature of the vulnerability means that successful exploitation requires user interaction with a maliciously crafted link, but the ease of implementation and potential for widespread impact makes it a significant security concern.

Organizations should prioritize immediate patching of affected PHP versions to address this vulnerability, following the security advisories provided by the PHP development team and their respective vendors. The mitigation strategy should include implementing proper input validation and output encoding mechanisms for all user-supplied data, particularly in error handling scenarios where URI parameters are displayed. Security teams should also consider implementing web application firewalls with XSS detection capabilities and conducting thorough security testing of all application components that handle user input. This vulnerability aligns with CWE-79 which categorizes cross-site scripting flaws, and maps to ATT&CK technique T1203 for exploitation of web applications, emphasizing the need for comprehensive security measures including regular vulnerability assessments and security updates to prevent exploitation of such persistent flaws in web application frameworks.

Reservation

01/16/2018

Moderation

accepted

Entry

2

Relate

show

CPE

ready

EPSS

0.89192

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!