Reflected XSS Vulnerability in PHP5 - PHAR Error Pages

php5 Updated 02 Oct 2025

Summary

29/04/2018
N/A
Yes i
Medium
6.1

ALPINE-CVE-2018-10547: An issue was discovered in ext/phar/phar_object.c in PHP before 5.6.36, 7.0.x before 7.0.30, 7.1.x before 7.1.17, and 7.2.x before 7.2.5. 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 is known for its flexibility, ease of use, and extensive community support. However, certain versions of PHP5 are vulnerable to a reflected cross-site scripting (XSS) attack, particularly in the handling of PHAR file error pages.

Vulnerability Detail

An issue was discovered in ext/phar/phar_object.c in PHP before version 5.6.36. This vulnerability allows for reflected XSS on the PHAR 403 and 404 error pages via request data when a .phar file is requested. The vulnerability arises from an incomplete fix for CVE-2018-5712, which could lead to malicious scripts being executed in the context of the user's browser, potentially compromising sensitive information.

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 disable the handling of PHAR files or implement strict input validation to prevent the execution of malicious scripts. However, this is not a permanent solution and updating the package is highly recommended.

Conclusion

The reflected XSS vulnerability in PHP5 related to PHAR error pages poses a significant risk to applications using affected versions. It is crucial to update to the patched version to mitigate potential attacks. Regular monitoring and vulnerability management practices, such as using tools like Vulert, can help maintain the security of your applications.

See every vulnerability recorded for php5 →

Share this vulnerability

FAQ

PHAR (PHP Archive) files are used to package PHP applications and libraries into a single file for easier distribution and deployment.

If your application uses PHP versions affected by this vulnerability, it may be susceptible to XSS attacks, allowing attackers to execute scripts in the context of your users' browsers.

The CVSS score for this vulnerability is 6.1, indicating a medium severity level.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json. You can check your application for vulnerabilities without any signup at the Vulert playground.

While this vulnerability primarily poses a risk of XSS attacks, it can lead to data exposure or loss if sensitive information is accessed through the compromised 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