CVE-2024-23648: Pimcore Admin Classic Bundle host header injection in the password reset
Summary
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.
It was identified during the audit that 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.
Details
This attack required the server to serve Pimcore on arbitrary "Host". This configuration would be plausible if the attacker is already behind the reverse proxy. During the assessment of my client, their instance was accepting any Host header, and they did not received security recommendations that they should restrict this while installing Pimcore.
From what I understood of Pimcore, the vulnerability is in the "admin-ui-classic-bundle", in the file src/Controller/Admin/UserController.php.
The following screenshots provide evidences of the vulnerability. The environment of the test is : dockerized Pimcore v11.1.1 on default configuration (https://pimcore.com/docs/platform/Pimcore/GettingStarted/Installation/DockerBasedInstallation/).
PoC !image !image
Remediation Create a variable that sets the server host. Don't enable password reset functionality while this variable is not set ; or make sure that the administrator knows what they are doing.
I believe that just documenting that the server should not serve on any Host would not be enough to enforce a remediation to this vulnerability.
The Snipe-IT project managed this same issue by creating a "APPALLOWINSECUREHOSTS" variable, and retrieving the app absolute URL from a config file : https://github.com/snipe/snipe-it/commit/0c4768fd2a11ac26a61814cef23a71061bfd8bcc
Impact Could lead to a 1-click account takeover
Other sources
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.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/pimcore/admin-ui-classic-bundleto a version that resolves this vulnerability.Fixed in 1.2.3 - Upgrade
Upgrade
pimcore/admin-ui-classic-bundleto a version that resolves this vulnerability.Fixed in 1.2.3 - Configuration
Configure the Pimcore instance (and any reverse proxy in front of it) to reject or not accept arbitrary Host headers; only allow the intended server host(s) so reset-password links cannot be generated with an attacker-controlled Host value. (The issue is described as being fixed in Pimcore v1.2.3.)
Pimcore Admin Classic Bundle Host header handling / allow insecure hosts = Do not serve on arbitrary Host headers; restrict accepted Host headers so the application cannot be reached with attacker-controlled Host values
Event History
Frequently Asked Questions
What is the severity of CVE-2024-23648?
CVE-2024-23648 is classified as a high severity vulnerability due to the risks associated with the exposure of the password reset token.
How do I fix CVE-2024-23648?
To fix CVE-2024-23648, update the Pimcore Admin UI Classic Bundle to version 1.2.3 or higher, which contains the necessary security patches.
What is the impact of CVE-2024-23648?
The impact of CVE-2024-23648 includes potential unauthorized access to user accounts if the unique password reset token is intercepted.
Is CVE-2024-23648 exploitable?
Yes, CVE-2024-23648 is exploitable if an attacker can gain access to the email containing the password reset link.
What versions are affected by CVE-2024-23648?
CVE-2024-23648 affects the Pimcore Admin UI Classic Bundle versions prior to 1.2.3.