Vulnerability in silverstripe/framework: ChangePasswordForm does not check Member::canLogIn()
Summary
GHSA-p5h2-vr99-xm99: silverstripe/framework ChangePasswordForm does not check Member::canLogIn(). Affects silverstripe/framework across 4 version ranges.
>= 3.1.19-rc1, < 3.1.20
>= 3.2.4-rc1, < 3.2.5
>= 3.3.2-rc1, < 3.3.3
>= 3.4.0-rc1, < 3.4.1
Fixed in 4 releases; the minimum fixed version depends 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/framework is a PHP framework used for building websites and web applications. It provides a range of features and functionalities to developers, including user authentication and password management. However, a vulnerability has been identified in the ChangePasswordForm component of the framework, which allows users to log in without proper authorization checks.
Vulnerability Detail
After performing a password reset, the ChangePasswordForm component in silverstripe/framework logs in the user without checking Member::canLogIn(). This poses a security risk for websites that rely on this method to deny access to certain users, such as those who have not been approved or have temporarily lost access privileges. While Member::canLogIn() was originally designed to check for lockouts due to incorrect login attempts, it has been expanded to other uses, potentially compromising the security of the application.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 3.1.19-rc1, < 3.1.203.1.20composer require silverstripe/framework:3.1.20 -
>= 3.2.4-rc1, < 3.2.53.2.5composer require silverstripe/framework:3.2.5 -
>= 3.3.2-rc1, < 3.3.33.3.3composer require silverstripe/framework:3.3.3 -
>= 3.4.0-rc1, < 3.4.13.4.1composer require silverstripe/framework:3.4.1
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If updating the framework is not immediately feasible, a temporary workaround can be implemented by modifying the ChangePasswordForm::doChangePassword() method to include a check for Member::canLogIn() before logging in the user. Here is an example of the modified code:
public function doChangePassword(array $data, Form $form)
{
// Existing code
...
// Additional check
if (!$this->member->canLogIn()) {
// Handle the case where the user is not allowed to log in
...
return;
}
// Log in the user
...
}
Conclusion
In conclusion, the silverstripe/framework package is vulnerable to a security issue in the ChangePasswordForm component. This vulnerability allows users to log in without proper authorization checks, potentially compromising the security of the application. It is recommended to update the framework to the latest stable release 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 silverstripe/framework →
FAQ
silverstripe/framework is a PHP framework used for building websites and web applications. It provides a range of features and functionalities to developers, including user authentication and password management.
This vulnerability allows users to log in without proper authorization checks, potentially granting access to unauthorized individuals. It can be particularly problematic for websites that rely on the Member::canLogIn() method to deny access to certain users.
To fix this vulnerability, it is recommended to update silverstripe/framework to the latest stable release (3.1.20, 3.2.5, 3.3.3, or 3.4.1). These versions include the necessary fixes to ensure proper authorization checks are performed before logging in a user.
Yes, if updating the framework is not immediately feasible, a temporary workaround can be implemented by modifying the ChangePasswordForm::doChangePassword() method to include a check for Member::canLogIn() before logging in the user. Refer to the 'workaround' section for example code.
You can find more information about this vulnerability, including its technical details and affected versions, in the advisory provided by the GitHub Advisory Database. The link to the advisory is available in the 'affected' section of the vulnerability details.
References
Related vulnerabilities
Recent vulnerabilities recorded for silverstripe/framework.