GHSA-9qv9-8xv6-5p35: phpMyFAQ: Unauthenticated Password Reset Endpoint Allows User Enumeration and Forced Password Change Without Token Validation
SummaryThe password reset API can be triggered without authentication and without any out-of-band confirmation step.If an attacker knows a valid `username + email` pair, they can call the reset endpoint directly. The application immediately generates a new password, writes it to the account, and only then sends the new password by email.This creates two issues at the same time:account enumeration through the response difference between valid and invalid pairsforced password reset of another user's account, which invalidates the old password immediatelyIn my local reproduction, I confirmed both the response difference and the password change itself.DetailsThe relevant code is in `phpmyfaq/src/phpMyFAQ/Controller/Frontend/Api/UnauthorizedUserController.php`.The route is exposed without authentication:The flow is straightforward:The core issue is that the password is changed immediately after a simple username and email match. There is no reset token, no confirmation link, no second step, and no requirement that the caller prove control of the mailbox before the password is replaced.That means the endpoint is not just a "forgot password email sender". It is an actual unauthenticated password change trigger.PoCThis was reproduced against a local Docker deployment of the project.For a valid username and email pair:Response:For an invalid pair:Response:That already confirms enumeration.To verify that the password really changes, created a test account:username: `user2`password: `Oldpass123!`email: `user2@example.com`Before calling the endpoint, the password hash stored in `faquserlogin` was:Then send:The response was:After that, the stored hash changed to:Then try to log in with the old password:The application redirected back to the login page and reported that the password was incorrect.So this is not just a cosmetic issue in the API response. The old credential really becomes invalid.ImpactThe most realistic impact here is forced password reset and account disruption.An attacker who knows or can guess a valid username and email pair can:confirm whether the pair is validforce the target account's password to changecause the victim's old password to stop working immediatelyIf the attacker does not control the victim's mailbox, this is usually a denial-of-service style account disruption rather than instant account takeover. That is the main reason I would keep the severity at **Medium**.Even so, this is still a real security issue. Password recovery should not allow an unauthenticated caller to change the account password directly.RemediationRecommend to change the password recovery flow to a token-based design.Do not change the password inside the unauthenticated endpoint.Generate a short-lived, single-use reset token and send only the reset link by email.Return the same generic response for both valid and invalid username/email pairs.Keep rate limiting in place, but do not rely on it as the main protection.Add regression tests that verify the password hash does not change until a valid reset token is presented.
CVSS v3.1: 8.2