Symfony: Programmatic Logins Skip the checkPostAuth() Method of User CheckersGHSA-8f57-m8wj-x65w
Fix: symfony/symfony@af0aae5GHSA-8f57-m8wj-x65w is a CWE-288 vulnerability in symfony/security-http. A fix is available for symfony/security-http — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-8f57-m8wj-x65w.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
symfony/security-http🐘symfony/security-http🐘symfony/security-http🐘symfony/security-http🐘symfony/symfony🐘symfony/symfony🐘symfony/symfony🐘symfony/symfonyReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | symfony/security-http | all versions | 5.4.56composer require symfony/security-http:^5.4.56 |
| 🐘Packagist | symfony/security-http | ≥ 6.0.0&&< 6.4.50 | 6.4.50composer require symfony/security-http:^6.4.50 |
| 🐘Packagist | symfony/security-http | ≥ 7.0.0&&< 7.4.23 | 7.4.23composer require symfony/security-http:^7.4.23 |
| 🐘Packagist | symfony/security-http | ≥ 8.0.0&&< 8.1.11 | 8.1.11composer require symfony/security-http:^8.1.11 |
| 🐘Packagist | symfony/symfony | all versions | 5.4.56composer require symfony/symfony:^5.4.56 |
| 🐘Packagist | symfony/symfony | ≥ 6.0.0&&< 6.4.50 | 6.4.50composer require symfony/symfony:^6.4.50 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for symfony/security-http, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update symfony/security-http to 5.4.56 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8f57-m8wj-x65w is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-8f57-m8wj-x65w in your dependencies?
Find it across Packagist, including transitive dependencies.