The vulnerability is a classic host header injection attack. The IRRd web UI was generating links for critical actions like password resets and account creation using the HTTP Host header provided by the client without proper validation. An attacker could provide a malicious Host header pointing to a domain they control. When a legitimate user requested a password reset, the confirmation link sent to their email would point to the attacker's domain. If the user clicked this link, the password reset token would be exposed to the attacker, allowing them to take over the user's account.
The analysis of the patches confirms this. The primary fix is in irrd/server/http/app.py, where the set_middleware function is modified to add starlette.middleware.trustedhost.TrustedHostMiddleware. This middleware ensures that all incoming requests have a Host header that matches the configured server.http.url, effectively blocking the injection attack.
Furthermore, a change in irrd/webui/auth/users.py within the PasswordResetToken._hash method confirms that the password reset functionality was an attack vector. The patch modifies the secret used to generate tokens, a necessary step to invalidate all existing tokens that could have been compromised before the fix was applied. The functions identified are either directly responsible for the missing security control (set_middleware) or are part of the functionality that was exploited (PasswordResetToken._hash).