← Vulnerability feed

Vulnerability record · CVE-2018-5712 · published 16 January 2018

CVE-2018-5712: PHP PHAR 404 page reflected XSS via request URI

Php · Php

PHP versions 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 reflect the request URI unescaped on the PHAR 404 error page when a .phar file is requested. An attacker who can get a victim to follow a crafted link can run script in the victim's browser in the context of the affected site. The record does not list specific affected distributions beyond PHP, Debian Linux and Ubuntu Linux.

6.1 CVSS 3.0 Medium EPSS 80% · top 0.4% CWE-79 · Cross-site scripting
6.1CVSS 3.0 base score, v2 4.3
80%EPSS exploitation probability, 30 days
NoNot in CISA KEV
3Affected product versions listed by NVD
26References
17 Jun 2026Last modified by NVD

Description

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.

CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

medium priorityReflected XSS requires user interaction and yields limited confidentiality and integrity impact, but the affected PHP versions are widely deployed and EPSS is very high.

What it is

PHP versions 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 reflect the request URI unescaped on the PHAR 404 error page when a .phar file is requested. An attacker who can get a victim to follow a crafted link can run script in the victim's browser in the context of the affected site. The record does not list specific affected distributions beyond PHP, Debian Linux and Ubuntu Linux.

Impact

An attacker gains script execution in the victim's browser session on the vulnerable origin, enabling theft of session cookies or other data reachable from that page and actions performed as the victim. The CVSS scope change (S:C) reflects impact beyond the vulnerable component.

Attack surface

Reached over the network by requesting a .phar file whose URI contains the payload; no authentication is required, but the victim must be induced to click a crafted link (UI:R). The flaw is in the PHAR 404 error page handling.

Exploitation

Not listed in CISA KEV and no ransomware usage is documented. EPSS is high (0.79949, 99.59th percentile), and references include vendor advisories, a PHP bug report tagged Patch, and distro errata, but no public exploit reference is given.

What to do

  • Upgrade PHP to 5.6.33, 7.0.27, 7.1.13, 7.2.1 or later; apply the referenced Debian, Ubuntu and Red Hat errata.
  • If immediate upgrade is not possible, restrict or disable serving of .phar files through the web server.
  • Deploy a WAF rule that blocks script payloads in request URIs targeting .phar paths.
  • Set session cookies HttpOnly and SameSite to limit theft via injected script.
  • Track vendor advisories for the affected PHP branches and confirm the installed version against the fixed releases.

Detection

  • Search web and proxy logs for requests to .phar paths whose URI contains script tags, event handlers or encoded angle brackets.
  • Alert on 404 responses for .phar requests with unusual query strings or path segments.
  • Review PHP error logs for PHAR 404 handling entries tied to suspicious request URIs.
  • Monitor for outbound or injected script patterns on pages served from PHP hosts running unpatched versions.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

3 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://php.net/ChangeLog-5.php Release NotesVendor Advisory
http://php.net/ChangeLog-7.php Release NotesVendor Advisory
http://www.securityfocus.com/bid/102742 Third Party AdvisoryVDB Entry
http://www.securityfocus.com/bid/104020 Third Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1040363 Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2018:1296 Third Party Advisory
https://access.redhat.com/errata/RHSA-2019:2519
https://bugs.php.net/bug.php?id=74782 Issue TrackingPatchVendor Advisory
https://lists.debian.org/debian-lts-announce/2018/01/msg00025.html Mailing ListThird Party Advisory
https://usn.ubuntu.com/3566-1/ Third Party Advisory
https://usn.ubuntu.com/3600-1/ Third Party Advisory
https://usn.ubuntu.com/3600-2/ Third Party Advisory
https://www.oracle.com/security-alerts/cpuapr2020.html
http://php.net/ChangeLog-5.php Release NotesVendor Advisory
http://php.net/ChangeLog-7.php Release NotesVendor Advisory
http://www.securityfocus.com/bid/102742 Third Party AdvisoryVDB Entry
http://www.securityfocus.com/bid/104020 Third Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1040363 Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2018:1296 Third Party Advisory
https://access.redhat.com/errata/RHSA-2019:2519
https://bugs.php.net/bug.php?id=74782 Issue TrackingPatchVendor Advisory
https://lists.debian.org/debian-lts-announce/2018/01/msg00025.html Mailing ListThird Party Advisory
https://usn.ubuntu.com/3566-1/ Third Party Advisory
https://usn.ubuntu.com/3600-1/ Third Party Advisory
https://usn.ubuntu.com/3600-2/ Third Party Advisory
https://www.oracle.com/security-alerts/cpuapr2020.html

Track CVE-2018-5712 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2024-4577PHP-CGI on Windows argument injection leads to remote code executionPHP-CGI on Windows can misinterpret characters in the command line passed to Win32 API functions when certain code pages are configured, due to Windo…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2018-5712), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.