Silverstripe Framework: Members with no password can be created and bypass custom login forms
Impact
When a new Member record was created in the cms it was possible to set a blank password. If an attacker knows the email address of the user with the blank password then they can attempt to log in using an empty password. The default member authenticator, login form and basic auth all require a non-empty password, however if a custom authentication method is used it may allow a successful login with the empty password. Starting with this release, blank passwords are no no longer allowed when members are created in the CMS. Programatically created Member records, such as those used in unit…
Source excerpt · OSVThe default member authenticator, login form and basic auth all require a non-empty password, however if a custom authentication method is used it may allow a successful login with the empty password.
Affected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| From 3.0.0 before 4.13.14Ecosystem versions | 4.13.14 |
| From 5.0.0 before 5.0.13Ecosystem versions | 5.0.13 |
Version evidence: OSV · GHSA-36xx-7vf6-7mv3
View original version evidence (328 explicit versions)
Original source description
When a new Member record was created in the cms it was possible to set a blank password. If an attacker knows the email address of the user with the blank password then they can attempt to log in using an empty password. The default member authenticator, login form and basic auth all require a non-empty password, however if a custom authentication method is used it may allow a successful login with the empty password. Starting with this release, blank passwords are no no longer allowed when members are created in the CMS. Programatically created Member records, such as those used in unit tests, still allow blank passwords. You may have some Member records in your system already which have empty passwords. To detect these, you can loop over all Member records with Member::get() and pass each record into the below method. It might be sensible to create a BuildTask for this purpose.
private function memberHasBlankPassword(Member $member): bool
{
// skip default admin as this is created programatically
if ($member->isDefaultAdmin()) {
return false;
}
// return true if a blank password is valid for this member
$authenticator = new MemberAuthenticator();
return $authenticator->checkPassword($member, '')->isValid();
}
Once you have identified the records with empty passwords, it's up to you how to handle this. The most sensible way to resolve this is probably to generate a new secure password for each of these members, mark it as immediately expired, and email each affected member (assuming they have a valid email address in the system).
Users would need to opt-in to insecure behavior by using a configuration which allowed for empty passwords. These configurations are not expected and hence this advisory is primarily informational in nature.
Reported by: Sabina Talipova from Silverstripe and Christian Bünte
References
- Security advisory github.com/silverstripe/silverstripe-framework/security/advisories/GHSA-36xx-7vf6-7mv3
- Security advisory nvd.nist.gov/vuln/detail/CVE-2023-32302
- Patch github.com/github/advisory-database/pull/2575
- Patch github.com/silverstripe/silverstripe-framework/commit/7b21b38ac4532d06565dfcefad50540ebd2b50f4
- Security advisory github.com/FriendsOfPHP/security-advisories/blob/master/silverstripe/framework/CVE-2023-32302.yaml
- Source reference github.com/silverstripe/silverstripe-framework
- Release notes github.com/silverstripe/silverstripe-framework/releases/tag/4.13.14
- Release notes github.com/silverstripe/silverstripe-framework/releases/tag/5.0.13
- Security advisory www.silverstripe.org/download/security-releases/CVE-2023-32302