The vulnerability is a password reset link poisoning issue in Taguette. The analysis started by identifying the patched version (1.5.0) and the last vulnerable version (1.4.1) from the provided information. By comparing the commits between these two versions, I was able to pinpoint the exact code changes that addressed the vulnerability.
The key commit, b56a67962c526981e18929438d1213c87c96b2a5, revealed a change in taguette/web/views.py. Specifically, in the post method of the ForgotPassword class, the code was changed from using self.request.host to self.application.config['DOMAIN'] when generating the password reset link. This is a direct mitigation for a host header injection vulnerability.
The vulnerable function is ForgotPassword.post. Before the patch, it used the Host header from the incoming request to construct the password reset link. An attacker could manipulate this header to point to a domain they control. If a user requested a password reset through a request forged by an attacker, the email they received would contain a link to the attacker's domain. Clicking this link would expose the password reset token to the attacker, allowing them to change the user's password and gain unauthorized access to their account.
The fix involves another commit, 7c8961e1500808ef0246732ea4f47ffe509d609c, which introduces a new configuration setting, DOMAIN. This setting provides a trusted, static domain name to be used for generating links, thus preventing the poisoning attack. The vulnerable function was then updated to use this secure configuration value instead of the untrusted input from the Host header.