The vulnerability lies in the failure to invalidate API tokens when a user changes their password. The analysis of the provided patch commit 649a2da81700542f95c0807b3c625fc3bb0eaf95 reveals that the fix was implemented in the weblate/accounts/forms.py file. Specifically, the save method of the SetPasswordForm class was modified to include a call to a new reset_api_token function. This form is used in both the password change view for logged-in users and the password reset flow. Before this change, the save method only changed the password without affecting the API token, allowing for continued unauthorized access. Therefore, the SetPasswordForm.save method is identified as the vulnerable function, as it was the component that lacked the necessary security measure.