VYPR
High severityNVD Advisory· Published Jan 24, 2024· Updated Jun 17, 2025

Pimcore Admin Classic Bundle host header injection in the password reset

CVE-2024-23648

Description

Pimcore's Admin Classic Bundle provides a backend user interface for Pimcore. The password reset functionality sends to the the user requesting a password change an email containing an URL to reset its password. The URL sent contains a unique token, valid during 24 hours, allowing the user to reset its password. This token is highly sensitive ; as an attacker able to retrieve it would be able to resets the user's password. Prior to version 1.2.3, the reset-password URL is crafted using the "Host" HTTP header of the request sent to request a password reset. This way, an external attacker could send password requests for users, but specify a "Host" header of a website that they control. If the user receiving the mail clicks on the link, the attacker would retrieve the reset token of the victim and perform account takeover. Version 1.2.3 fixes this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
pimcore/admin-ui-classic-bundlePackagist
< 1.2.31.2.3

Affected products

1

Patches

1
70f2205b5a5e

Password reset - fix for possible host header injection (#362)

1 file changed · +22 6
  • src/Controller/Admin/LoginController.php+22 6 modified
    @@ -32,6 +32,7 @@
     use Pimcore\Logger;
     use Pimcore\Model\User;
     use Pimcore\Security\SecurityHelper;
    +use Pimcore\SystemSettingsConfig;
     use Pimcore\Tool;
     use Pimcore\Tool\Authentication;
     use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
    @@ -44,6 +45,7 @@
     use Symfony\Component\RateLimiter\RateLimiterFactory;
     use Symfony\Component\Routing\Annotation\Route;
     use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
    +use Symfony\Component\Routing\RouterInterface;
     use Symfony\Component\Security\Core\Exception\AuthenticationException;
     use Symfony\Component\Security\Core\Security;
     use Symfony\Component\Security\Core\User\UserInterface;
    @@ -194,7 +196,13 @@ public function loginCheckAction(Request $request): RedirectResponse
         /**
          * @Route("/login/lostpassword", name="pimcore_admin_login_lostpassword")
          */
    -    public function lostpasswordAction(Request $request, CsrfProtectionHandler $csrfProtection, Config $config, RateLimiterFactory $resetPasswordLimiter): Response
    +    public function lostpasswordAction(
    +        Request $request,
    +        CsrfProtectionHandler $csrfProtection,
    +        Config $config,
    +        RateLimiterFactory $resetPasswordLimiter,
    +        RouterInterface $router
    +    ): Response
         {
             $params = $this->buildLoginPageViewParams($config);
             $error = null;
    @@ -226,12 +234,20 @@ public function lostpasswordAction(Request $request, CsrfProtectionHandler $csrf
                 if (!$error) {
                     $token = Authentication::generateTokenByUser($user);
     
    -                $loginUrl = $this->generateUrl('pimcore_admin_login_check', [
    -                    'token' => $token,
    -                    'reset' => 'true',
    -                ], UrlGeneratorInterface::ABSOLUTE_URL);
    -
                     try {
    +                    $domain = SystemSettingsConfig::get()['general']['domain'];
    +                    if (!$domain) {
    +                        throw new \Exception('No main domain set in system settings, unable to generate reset password link');
    +                    }
    +
    +                    $context = $router->getContext();
    +                    $context->setHost($domain);
    +
    +                    $loginUrl = $this->generateUrl('pimcore_admin_login_check', [
    +                        'token' => $token,
    +                        'reset' => 'true',
    +                    ], UrlGeneratorInterface::ABSOLUTE_URL);
    +
                         $event = new LostPasswordEvent($user, $loginUrl);
                         $this->eventDispatcher->dispatch($event, AdminEvents::LOGIN_LOSTPASSWORD);
     
    

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

4

News mentions

0

No linked articles in our index yet.