High severity7.5NVD Advisory· Published Nov 29, 2024· Updated Apr 15, 2026
CVE-2024-36611
CVE-2024-36611
Description
In Symfony v7.07, a security vulnerability was identified in the FormLoginAuthenticator component, where it failed to adequately handle cases where the username or password field of a login request is empty. This flaw could lead to various security risks, including improper authentication logic handling or denial of service. NOTE: the Supplier has concluded that this is a false report.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
symfony/security-httpPackagist | < 7.1.0 | 7.1.0 |
Patches
2a804ca15fcad[Security] Ignore empty username or password login attempts
3 files changed · +33 −0
src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php+8 −0 modified@@ -129,12 +129,20 @@ private function getCredentials(Request $request): array $credentials['username'] = trim($credentials['username']); + if ('' === $credentials['username']) { + throw new BadRequestHttpException(sprintf('The key "%s" must be a non-empty string.', $this->options['username_parameter'])); + } + $request->getSession()->set(SecurityRequestAttributes::LAST_USERNAME, $credentials['username']); if (!\is_string($credentials['password']) && (!\is_object($credentials['password']) || !method_exists($credentials['password'], '__toString'))) { throw new BadRequestHttpException(sprintf('The key "%s" must be a string, "%s" given.', $this->options['password_parameter'], \gettype($credentials['password']))); } + if ('' === (string) $credentials['password']) { + throw new BadRequestHttpException(sprintf('The key "%s" must be a non-empty string.', $this->options['password_parameter'])); + } + return $credentials; }
src/Symfony/Component/Security/Http/CHANGELOG.md+1 −0 modified@@ -6,6 +6,7 @@ CHANGELOG * Add `#[IsCsrfTokenValid]` attribute * Add CAS 2.0 access token handler + * Make empty username or empty password on form login attempts return Bad Request (400) 7.0 ---
src/Symfony/Component/Security/Http/Tests/Authenticator/FormLoginAuthenticatorTest.php+24 −0 modified@@ -42,6 +42,30 @@ protected function setUp(): void $this->failureHandler = $this->createMock(AuthenticationFailureHandlerInterface::class); } + public function testHandleWhenUsernameEmpty() + { + $this->expectException(BadRequestHttpException::class); + $this->expectExceptionMessage('The key "_username" must be a non-empty string.'); + + $request = Request::create('/login_check', 'POST', ['_username' => '', '_password' => 's$cr$t']); + $request->setSession($this->createSession()); + + $this->setUpAuthenticator(); + $this->authenticator->authenticate($request); + } + + public function testHandleWhenPasswordEmpty() + { + $this->expectException(BadRequestHttpException::class); + $this->expectExceptionMessage('The key "_password" must be a non-empty string.'); + + $request = Request::create('/login_check', 'POST', ['_username' => 'foo', '_password' => '']); + $request->setSession($this->createSession()); + + $this->setUpAuthenticator(); + $this->authenticator->authenticate($request); + } + /** * @dataProvider provideUsernamesForLength */
db8770712485Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/advisories/GHSA-7q22-x757-cmgcghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-36611ghsaADVISORY
- gist.github.com/1047524396/3581425e0911b716cf8ce4fa30e41e6cnvdWEB
- github.com/github/advisory-database/pull/5046nvdWEB
- github.com/symfony/symfony/blob/v7.0.7/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.phpnvdWEB
- github.com/symfony/symfony/commit/a804ca15fcad279d7727b91d12a667fd5b925995nvdWEB
- github.com/symfony/symfony/issues/59077nvdWEB
News mentions
0No linked articles in our index yet.