CVE-2021-21424: Prevent user enumeration in authentication mechanisms

Affected versions

Symfony >=2.8.0, <3.4.49 || >= 4.0.0, <4.4.24 || >= 5.0.0, <5.2.9 versions of the Symfony Security, Security Guard, Security Core, and Security HTTP components are affected by this security issue.

The issue has been fixed in Symfony 3.4.49, 4.4.24, 5.2.9, and 5.3.0 RC1. All other affected minor versions of Symfony won’t be patched as they are not maintained anymore.

Description

The ability to enumerate users was possible without relevant permissions due to different exception messages depending on whether the user existed or not. It was also possible to enumerate users by using a timing attack, by comparing time elapsed when authenticating an existing user and authenticating a non-existing user.

We now ensure that 403s are returned whether the user exists or not if the password is invalid or if the user does not exist.

The patch for this issue is available here and here also for branch 3.4.

Credits

I would like to thank James Isaac, Mathias Brodala and Laurent Minguet for reporting the issue and Robin Chalas for fixing the issue.

Manage your notification preferences to receive an email as soon as a Symfony security release is published.
If you have found a security issue in Symfony, please send the details to security [at] symfony.com and don't disclose it publicly until we can provide a fix for it.
Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.

CVE-2021-21424: Prevent user enumeration in authentication mechanisms symfony.com/blog/cve-2021-21424-prevent-user-enumeration-in-authentication-mechanisms

Tweet this

Comments

In case this causes issues for you (I have for example a case where we need to know the exact failing reason to report some special cases like account disabled to the user, and accept that these users can be enumerated), you can turn off this fix via https://symfony.com/doc/current/reference/configuration/security.html#hide-user-not-found
Good catch !
Thanks 👍
I found out the patch for this CVE has been fixed to version 4.4.* for the components symfony/security-guard and symfony/security-core.
Could you please confirm the fix has also been implemented for the version 4.4.22 of the component security/symfony-http?
I'm asking because I saw the fix here https://github.com/symfony/security-http/commit/c55a8f70fb2a04cf8ec3263d337abb3f22fc0132 but according to our internal Static Code Analysis (and SCA) tool, this version doesn't fix the CVE.
Thank you in advance!
I made a mistake in my last comment:
"security/symfony-http" must be "symfony/security-http"
Login with SymfonyConnect to post a comment