Reflected XSS Vulnerability in PHP5 on Alpine Linux: CVE-2018-5712

php5 Updated 02 Oct 2025

Summary

16/01/2018
N/A
Yes i
Medium
6.1

ALPINE-CVE-2018-5712: 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. Affects php5 versions < 5.6.36-r0. Fixed in 5.6.36-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PHP5 is a widely-used open-source scripting language designed for web development but also used as a general-purpose programming language. It allows developers to create dynamic web pages and applications. The vulnerability in question affects versions of PHP5 prior to 5.6.36-r0, exposing applications to reflected cross-site scripting (XSS) attacks through the PHAR 404 error page.

Vulnerability Detail

An issue was discovered in PHP before version 5.6.33, where the PHAR (PHP Archive) 404 error page is susceptible to reflected XSS. This vulnerability allows an attacker to craft a malicious request for a .phar file, which, if accessed by a user, could execute arbitrary scripts in the context of the user's session. The potential ramifications include unauthorized access to sensitive information and manipulation of user sessions.

How To Fix

Minimum fixed version

5.6.36-r0

This is the first release that contains the fix.

sudo apk add --upgrade php5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can restrict access to .phar files or implement input validation to sanitize user inputs. This can help mitigate the risk of XSS attacks until the package is updated.

Conclusion

The CVE-2018-5712 vulnerability in PHP5 poses a significant risk due to its potential for reflected XSS attacks. It is crucial for users to update their PHP5 installations to the patched version 5.6.36-r0 to safeguard their applications. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for php5 →

Share this vulnerability

FAQ

CVE-2018-5712 is a vulnerability in PHP5 that allows for reflected XSS attacks via the PHAR 404 error page.

You can use Vulert, which monitors open-source vulnerabilities in your software using a manifest file like package-lock.json. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.

If exploited, this vulnerability can lead to unauthorized access to user sessions and sensitive data, potentially compromising the security of your application.

Yes, the patched version of PHP5 is 5.6.36-r0. Updating to this version will resolve the vulnerability.

Reflected XSS is a type of attack where malicious scripts are reflected off a web server, allowing attackers to execute scripts in the context of a user's session.

Related vulnerabilities

Recent vulnerabilities recorded for php5.

How To Fix

Minimum fixed version

5.6.36-r0

This is the first release that contains the fix.

sudo apk add --upgrade php5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback