Executive brief
CouchAuth is an authentication library for Node.js applications. A host header injection vulnerability allows attackers to craft password reset emails that redirect users to attacker-controlled servers, capturing password reset tokens and enabling account takeover. An attacker can reset any user's password and seize control of their account.
Technical details
A host header injection vulnerability exists in @perfood/couch-auth versions <= 0.20.0 in the password reset functionality. An attacker sends a specially crafted Host header in a forgot-password request, causing the application to embed a malicious domain in the password reset link sent to users. When a user clicks the link, their password reset token is leaked to the attacker-controlled server. No authentication is required to trigger the vulnerability; user interaction (clicking the link) is necessary. An attacker can subsequently use the stolen token to reset the victim's password and take over their account. The issue affects all versions up to and including 0.20.0.
Affected products
- perfood couch-auth through 0.20.0
Timeline
- 2023-08: disclosed: Vulnerability discovered by Florian Walter
- 2024-01-03: advisory: CVE-2023-39655 and GHSA-fqh6-6h6c-366m published