The vulnerability lies in the password change functionality, specifically in how the old password was verified. The provided commit e0f1841b310f6f610e8137db2506cf683ce154d0 shows changes in vantage6-server/vantage6/server/resource/recover.py.
The key change is within the Password class, in its patch method.
Before the patch, the code was:
# check if the old password is correct
pw_correct = user.check_password(old_password)
if not pw_correct:
return {
"msg": "Your current password is not correct!"
}, HTTPStatus.UNAUTHORIZED
This direct check user.check_password(old_password) lacked any mechanism to prevent repeated attempts, thus allowing a brute-force attack on the current password if an attacker had an active session.
The patch replaced this with:
user_or_error, code = user_login(
self.config, user.username, old_password, self.mail
)
if code != HTTPStatus.OK:
return user_or_error, code
The user_login function, which is also used for regular logins, is expected to have brute-force protection (e.g., account lockout, rate limiting). By routing the current password verification through user_login, the password change functionality now benefits from these protections.
Therefore, the patch method of the Password class (fully qualified name vantage6.server.resource.recover.Password.patch) was the vulnerable function as it processed the password change request and, prior to the patch, allowed an unlimited number of attempts to verify the old password.