Silverstripe Framework - External Redirection Risk in Security?ReturnURL
Summary
GHSA-vp8p-c6xj-xpj7: Silverstripe External redirection risk in Security?ReturnURL. Affects silverstripe/framework across 2 version ranges.
< 3.0.14
>= 3.1.0, < 3.1.13
Fixed in 3.0.14 or 3.1.13, depending on the release line you run. 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
SilverStripe is a popular PHP framework used for building websites and web applications. It provides a range of features and functionalities to developers, including user authentication and security measures. However, a vulnerability has been discovered in the framework's Security?ReturnURL functionality, which can potentially allow for external redirection attacks. This vulnerability affects versions 3.0.13 and below, as well as versions 3.1.13-rc1 and below.
Vulnerability Detail
The vulnerability in the SilverStripe framework allows an attacker to redirect the login URL to an external site. This can be exploited by crafting a malicious URL that includes an attacker-controlled BackURL parameter. For example, if a user visits the login page with the URL http://www.my-silverstripe-site.com/Security/login?BackURL=/attacker-site.com, successful logins will be redirected to http://attacker-site.com. If the attacker's site is designed to mimic the original login page and display a fake 'login failed' message, the user may unknowingly enter their credentials again, potentially exposing them to the attacker.
The impact of this vulnerability can range from unauthorized access to user accounts to phishing attacks and credential theft.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 3.0.143.0.14composer require silverstripe/framework:3.0.14 -
>= 3.1.0, < 3.1.133.1.13composer require silverstripe/framework:3.1.13
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, developers can manually validate and sanitize the BackURL parameter before processing it. This can be done by checking if the URL starts with the expected domain or by using a whitelist of allowed domains. Here is an example of how to sanitize the BackURL parameter in PHP:
$backUrl = $_GET['BackURL'];
$allowedDomain = 'my-silverstripe-site.com';
if (strpos($backUrl, $allowedDomain) !== 0) {
// Handle invalid BackURL
}
// Process the valid BackURL
It is important to note that this workaround should only be used as a temporary measure until the framework is updated to a secure version.
Conclusion
The SilverStripe framework is vulnerable to an external redirection risk in the Security?ReturnURL functionality. This can potentially lead to unauthorized access, phishing attacks, and credential theft. It is crucial for developers to upgrade to the latest secure version of the framework and implement proper input validation and sanitization to mitigate this vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for silverstripe/framework →
FAQ
The vulnerability can lead to unauthorized access to user accounts, phishing attacks, and credential theft.
Versions 3.0.13 and below, as well as versions 3.1.13-rc1 and below, are affected.
Yes, the vulnerability has been fixed in version 3.0.14 for versions 3.0.x and in version 3.1.13 for versions 3.1.x.
To protect your application, it is recommended to upgrade to a fixed version of the SilverStripe framework and validate/sanitize user input.
Yes, developers can manually validate and sanitize the BackURL parameter as a temporary workaround until the framework is updated.
References
Related vulnerabilities
Recent vulnerabilities recorded for silverstripe/framework.