The vulnerability, identified as GHSA-7w52-7jvm-m9vw, is a timing attack that allows for the enumeration of administrator usernames and client IDs in Shopware. The root cause lies in how authentication requests are handled. When a request is made with a username or client ID, the system's response time differs depending on whether the entity exists.
Specifically, in the Shopware\Core\Framework\Api\OAuth\UserRepository::getUserEntityByUserCredentials function, if a username does not exist, the function returns immediately. However, if the username is valid, the function proceeds to call PHP's password_verify function, which is computationally intensive by design to prevent brute-force attacks. This measurable difference in execution time between a failed and successful username lookup allows an attacker to determine which usernames are registered in the system.
The same flaw was identified in the Shopware\Core\Framework\Api\OAuth\ClientRepository for client ID validation in the validateClient and getClientEntity methods.
The security patch mitigates this vulnerability by removing the early return. Instead, if a user or client is not found, the code now creates dummy data and proceeds to call password_verify with values guaranteed to fail. This ensures that the execution time is consistent, whether the provided credential is valid or not, thus neutralizing the timing attack vector.