CVE-2026-123746: Programmatic Logins Skip the checkPostAuth() Method of User Checkers
Description
Security::login() and UserAuthenticatorInterface::authenticateUser() log a user in programmatically, for example after a password reset or after an email verification link. The fix for CVE-2024-50341 made Security::login() call the checkPreAuth() method of the user checker of the firewall. But neither method ran checkPostAuth(): this method runs on the security.authentication.success event, which AuthenticatorManager::authenticateUser() did not dispatch.
As a consequence, an account that a user checker rejects in checkPostAuth(), such as an expired account, was refused by form login and the other authenticators of the firewall, but could still be logged in through these methods.
Applications are affected when they use a custom user checker that rejects users in checkPostAuth() and log users in programmatically. On 6.4 and up, the default user checker does nothing in checkPostAuth(). On 5.4, it rejects users of the deprecated User class whose credentials expired.
Resolution
AuthenticatorManager::authenticateUser() now dispatches the security.authentication.success event once the token is created and before it is stored, as authentications through the firewall do. checkPostAuth() runs on this event and can reject the user.
As a consequence, an exception thrown by checkPostAuth() now comes out of Security::login() and authenticateUser(). Code that logs users in programmatically, such as a registration controller, may need to catch it.
UserAuthenticatorInterface::authenticateUser() still doesn't call checkPreAuth(), on purpose. That's where checks like "the email isn't verified yet" usually are, and registration controllers use this method to log in users that just registered.
The patches for this issue are available here for branch 5.4 (and forward-ported to 6.4, 7.4, 8.1 and 8.2).
Credits
Symfony would like to thank Vincent Cassiau (CyberVanguard) for reporting the issue and Nicolas Grekas for providing the fix.
Symfony would also like to thank Bruno Dias from Checkmarx for their help getting a CVE assigned.
Other sources
Programmatic Logins Skip the checkPostAuth() Method of User Checkers
— Packagist
The Symfony Security HTTP component AuthenticatorManager::authenticateUser() does not run the firewall user checker’s checkPostAuth() method when a user is authenticated programmatically, allowing an account rejected by a custom user checker, such as an expired account, to be authenticated in Symfony versions prior to 5.4.56, 6.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.
AuthenticatorManager::authenticateUser() is used by UserAuthenticatorInterface::authenticateUser() and by the SecurityBundle’s Security::login() to authenticate a user programmatically, but it does not dispatch the security.authentication.success event, on which checkPostAuth() runs. The fix for CVE-2024-50341 made Security::login() call checkPreAuth(), but checkPostAuth() was still skipped. As a result, an account rejected by a custom user checker in checkPostAuth() is refused by form login and the other authenticators of the firewall, but can still be authenticated programmatically.
Applications are affected when they use a custom user checker that rejects users in checkPostAuth() and authenticate users programmatically, for example after a password reset or an e-mail verification link. A user whose account is rejected can then obtain an authenticated session through that flow. The default user checker does nothing in checkPostAuth(), so the default configuration is not affected.
The fix makes AuthenticatorManager::authenticateUser() dispatch the security.authentication.success event once the token is created and before it is stored, as authentications through the firewall do, so that checkPostAuth() runs and can reject the user.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/symfony/symfonyto a version that resolves this vulnerability.Fixed in 5.4.56 - Upgrade
Upgrade
composer/symfony/symfonyto a version that resolves this vulnerability.Fixed in 6.4.50 - Upgrade
Upgrade
composer/symfony/symfonyto a version that resolves this vulnerability.Fixed in 7.4.23 - Upgrade
Upgrade
composer/symfony/symfonyto a version that resolves this vulnerability.Fixed in 8.1.11 - Upgrade
Upgrade
composer/symfony/security-httpto a version that resolves this vulnerability.Fixed in 5.4.56 - Upgrade
Upgrade
composer/symfony/security-httpto a version that resolves this vulnerability.Fixed in 6.4.50 - Upgrade
Upgrade
composer/symfony/security-httpto a version that resolves this vulnerability.Fixed in 7.4.23 - Upgrade
Upgrade
composer/symfony/security-httpto a version that resolves this vulnerability.Fixed in 8.1.11 - Upgrade
Upgrade
debian/symfonyto a version that resolves this vulnerability.Fixed in 6.4.50+dfsg-0+deb13u1 - Upgrade
Upgrade
debian/symfonyto a version that resolves this vulnerability.Fixed in 7.4.23+dfsg-1 - Upgrade
Upgrade
debian/symfonyto a version that resolves this vulnerability.Fixed in 6.4.50+dfsg-0+deb13u1Fixed in 7.4.23+dfsg-1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.4.56 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.4.50 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.4.23 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.1.11 - Operational
Update programmatic login code to catch exceptions from checkPostAuth() when using Security::login() or authenticateUser().
Event History
Frequently Asked Questions
Which applications are affected in practice?
Applications are affected when they both use a custom firewall user checker that rejects users in checkPostAuth() and authenticate users programmatically. Examples include programmatic authentication after a password reset or through an e-mail verification link.
What must an attacker or user be able to do to trigger the issue?
They need to reach an application flow that authenticates their account programmatically through UserAuthenticatorInterface::authenticateUser() or Security::login(). The account must be one that the application's custom checkPostAuth() logic would normally reject.
Are ordinary firewall authentication flows affected?
Form login and the firewall's other authenticators refuse accounts rejected by the custom checkPostAuth() user checker. The bypass occurs specifically through programmatic authentication paths.
How can I determine whether my application is exposed?
Review custom user checkers for rejection logic implemented in checkPostAuth(), then identify uses of UserAuthenticatorInterface::authenticateUser() or Security::login(). If both are present, test whether a user rejected by checkPostAuth() can authenticate through those programmatic flows.
What can be done before upgrading?
Avoid programmatically authenticating accounts that require post-authentication eligibility checks, or explicitly perform the equivalent checkPostAuth() validation before completing the programmatic login. Upgrade affected Symfony versions to 5.4.56, 6.4.50, 7.4.23, or 8.1.11 or later within the applicable release line.