CVE-2015-3257: zend-diactoros Cross-site Scripting (XSS)

zendframework/zend-diactoros Updated 02 Oct 2025

Summary

17/05/2022
Yes i
Moderate
6.1

CVE-2015-3257: zend-diactoros Cross-site Scripting (XSS). Affects zendframework/zend-diactoros versions >= 1.0.0, < 1.0.4. Fixed in 1.0.4. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The zend-diactoros package is a component of the Zend Framework, specifically designed for HTTP message implementations. It provides a set of classes for creating and manipulating HTTP messages, including requests and responses. This package is widely used in PHP applications to handle HTTP communication.

Vulnerability Detail

The vulnerability identified as CVE-2015-3257 in zend-diactoros before version 1.0.4 is a cross-site scripting (XSS) vulnerability. The issue arises from the improper sanitization of path input in the Zend/Diactoros/Uri::filterPath function. This allows remote attackers to potentially execute malicious scripts or perform open redirect attacks. The impact of this vulnerability can range from unauthorized access to sensitive information to the execution of arbitrary code on the victim's browser.

How To Fix

Minimum fixed version

1.0.4

This is the first release that contains the fix.

composer require zendframework/zend-diactoros:1.0.4

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

Workaround

If upgrading to the latest version is not immediately possible, developers can implement a workaround by manually sanitizing the path input before passing it to the Zend/Diactoros/Uri::filterPath function. This can be done by using a reliable HTML sanitizer library or by implementing custom sanitization logic. Here is an example of how to sanitize the path input using the htmlpurifier library:

use HTMLPurifier;

$path = $_GET['path'];
$sanitizedPath = HTMLPurifier::getInstance()->purify($path);

// Pass the sanitized path to Zend/Diactoros/Uri::filterPath
// ... rest of the code ...

It is important to note that this workaround is temporary and should be replaced with the official fix as soon as possible.

Conclusion

In conclusion, the zend-diactoros package before version 1.0.4 is vulnerable to cross-site scripting (XSS) attacks. It is crucial for developers to upgrade to the latest version or apply the provided workaround to mitigate the risk. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for zendframework/zend-diactoros →

Share this vulnerability

FAQ

zend-diactoros is a package in the Zend Framework that provides HTTP message implementations for PHP applications. It is commonly used for handling HTTP communication, including requests and responses.

The vulnerability allows remote attackers to perform cross-site scripting (XSS) attacks or open redirect attacks. This can lead to unauthorized access to sensitive information or the execution of malicious scripts on the victim's browser.

To fix this vulnerability, it is recommended to upgrade the zend-diactoros package to version 1.0.4 or later. This version includes the necessary fixes to properly sanitize path input and prevent XSS attacks.

If upgrading to the latest version is not immediately possible, developers can implement a workaround by manually sanitizing the path input before passing it to the Zend/Diactoros/Uri::filterPath function. This can be done using a reliable HTML sanitizer library or by implementing custom sanitization logic.

Certainly! Here is an example of how to sanitize the path input using the htmlpurifier library:

use HTMLPurifier;

$path = $_GET['path'];
$sanitizedPath = HTMLPurifier::getInstance()->purify($path);

// Pass the sanitized path to Zend/Diactoros/Uri::filterPath
// ... rest of the code ...

Related vulnerabilities

Recent vulnerabilities recorded for zendframework/zend-diactoros.

How To Fix

Minimum fixed version

1.0.4

This is the first release that contains the fix.

composer require zendframework/zend-diactoros:1.0.4

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

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.