CVE-2015-1039: ZF-Commons ZfcUser Vulnerable to XSS in Login Redirect
Summary
CVE-2015-1039: ZF-Commons ZfcUser Vulnerable to XSS in Login Redirect. Affects zf-commons/zfc-user versions < 1.2.2. Fixed in 1.2.2. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
ZF-Commons ZfcUser is a package available on Packagist that provides user authentication and management functionality for Zend Framework applications. It allows developers to easily implement user registration, login, and other related features. However, versions prior to 1.2.2 are vulnerable to a cross-site scripting (XSS) attack in the login redirect functionality.
Vulnerability Detail
The vulnerability in ZF-Commons ZfcUser arises from a lack of proper input validation and sanitization in the user/login.phtml file. This allows remote attackers to inject arbitrary web script or HTML via the redirect parameter. An attacker could exploit this vulnerability to execute malicious code in the context of a user's browser, potentially leading to session hijacking, data theft, or other unauthorized actions.
How To Fix
Minimum fixed version
1.2.2
This is the first release that contains the fix.
composer require zf-commons/zfc-user:1.2.2
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 feasible, a temporary workaround can be implemented by manually validating and sanitizing the redirect parameter in the affected user/login.phtml file. Here is an example of how to sanitize the redirect parameter using PHP's htmlspecialchars function:
$redirect = htmlspecialchars($_GET['redirect'], ENT_QUOTES, 'UTF-8');
Conclusion
In conclusion, ZF-Commons ZfcUser versions prior to 1.2.2 are vulnerable to a cross-site scripting (XSS) attack in the login redirect functionality. It is crucial to upgrade to the patched version or implement the provided workaround to mitigate the risk of exploitation. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for zf-commons/zfc-user →
FAQ
ZF-Commons ZfcUser is a package that provides user authentication and management functionality for Zend Framework applications.
This vulnerability allows remote attackers to inject malicious code into the login redirect parameter, potentially leading to session hijacking, data theft, or other unauthorized actions.
To fix this vulnerability, upgrade to version 1.2.2 or later of ZF-Commons ZfcUser. Alternatively, you can manually sanitize the redirect parameter in the affected file.
Yes, a temporary workaround is to manually sanitize the redirect parameter in the affected file using PHP's htmlspecialchars function.
You can find more information about this vulnerability in the CVE-2015-1039 advisory and the GitHub advisory database.