VYPR
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.

PackageAffected versionsPatched versions
symfony/security-httpPackagist
< 7.1.07.1.0

Patches

2
a804ca15fcad

[Security] Ignore empty username or password login attempts

https://github.com/symfony/symfonyllupaFeb 10, 2024via ghsa
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
          */
    

Vulnerability 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

News mentions

0

No linked articles in our index yet.