Authentication is the part of a product that decides who someone is. If it is weak, every other control becomes a question of whether an attacker can impersonate a legitimate user. Most authentication problems do not appear on the login form itself. They appear in the flows around it: sign-up, password reset, email change, invitations, sessions and tokens.
This checklist walks through those flows in order and gives each one a concrete check. For the basics of how a full test is structured, read web application security testing. For a quick look at the account side of a public website, see how to check if a website is secure.
What Authentication Covers
Authentication is every path that proves identity or keeps it. In a typical product that means sign-up and email verification, login with a password or a magic link, single sign-on through a provider, multi-factor authentication, password reset, email and phone changes, session cookies, API tokens, invitations to a team and account deletion.
Each of those is a door. A strong login form does not help if the reset flow opens a second door into the same account. Walk every flow, and test each one as a user who does not own the account.
Sign-Up and Account Creation
- Email verification is required before sensitive actions. A new account should not be able to invite others, change billing or access admin features until the address is confirmed.
- Account enumeration is limited. The sign-up response should not reveal whether an email already exists, or should do so only in a way that is hard to exploit at scale.
- Rate limits apply. Automated sign-ups should be slowed down, especially where each account triggers an email or a paid action.
- Usernames and IDs are not guessable secrets. An account identifier can be public, but it must never be the only thing that protects a sensitive action.
Login and Brute-Force Protection
- Failed attempts are throttled. After a set number of failures, the login should slow down, lock temporarily or require extra verification. Verify this by sending repeated wrong passwords for one account.
- Limits apply per account and per source. Throttling by IP address alone is easy to bypass with a list of addresses, and throttling by account alone can lock out real users. Check both.
- Errors are generic. A message such as "invalid email or password" is safer than separate messages for unknown accounts and wrong passwords.
- Timing and response size do not reveal accounts. Two responses that differ only in speed or length can leak whether an account exists.
The OWASP Authentication Cheat Sheet covers these rules in detail, and it is a good reference when you write fixes.
Password Rules and Storage
Passwords should be long enough to resist guessing, checked against lists of known breached passwords, and never forced to change on a fixed schedule without a reason. Length is more useful than complexity rules.
Storage is not visible from outside, so the test is indirect. Make sure the application never returns password hashes in any API response, never writes passwords to logs, and never sends a user's current password back by email. A password reset should always create a new password, never reveal the old one. The hash itself should use a slow, salted algorithm designed for passwords, such as Argon2id, which OWASP recommends first.
Password Reset and Email Change
These are the most abused flows in most applications, because they can hand over an account without the password at all.
- Reset links expire, typically within minutes to a few hours, and they are single use.
- Reset tokens are random and long, and they are never reused after a successful reset.
- The response does not reveal accounts. A reset request for an unknown address should look the same as one for a real address.
- Changing the password ends other sessions, so an attacker who had a session cannot keep it.
- Email change requires confirmation, and it notifies the old address. A change that takes effect instantly lets a stolen session move the account to an attacker's inbox.
- Recovery codes are treated as passwords. They are shown once, stored safely and cannot be used to bypass MFA without the right checks.
To test, request a reset, use the link once, then try to use it a second time. Request another, wait past its expiry and try again. Compare the response for a real and a fake address.
Multi-Factor Authentication
MFA is one of the strongest controls available, and it is only as strong as the flows that surround it. Check that:
- MFA cannot be skipped by calling the next step of the login directly.
- Sessions created before MFA was enabled are re-checked or ended.
- Disabling MFA requires a fresh verification, not just an active session.
- Recovery paths do not sit outside MFA, for example a support flow that resets it by email alone.
- Codes are single use and time limited, and repeated code guesses are throttled.
Sessions and Cookies
A session is the proof that someone is logged in, so it needs the same care as a password. Session cookies should carry Secure, so they travel only over HTTPS, HttpOnly, so scripts cannot read them, and SameSite, which limits cross-site requests. The OWASP Session Management Cheat Sheet describes these in detail.
Test the lifecycle, not only the attributes. Log out, then replay the old session cookie. Change the password, then check whether the old session still works. Set an idle timeout and confirm it ends the session. Log in on a second device and see whether logging out on the first one affects the second, which depends on your design, but should be deliberate.
Tokens, API Keys and Integrations
API tokens and keys are authentication too, and they often outlive the people who created them. Check that tokens can be listed and revoked by their owner, that removed users lose access immediately, and that keys have limited scopes. JWTs need extra care: confirm the server rejects tokens with a missing or weak signature, checks the expiry and does not trust claims the client can edit. For the API side of this, read API security testing.
OAuth, Single Sign-On and Magic Links
Third-party sign-in moves the trust to another provider, and it adds its own traps. Check that the state parameter is validated, that redirect addresses are on a strict allowlist, that an account linked through one provider cannot be taken over by an email that the provider has not verified, and that a magic link is single use and short-lived. Ensure that signing in with a provider cannot create a session for a different account than the one the user chose.
Invitations and Account Removal
Team invitations are a frequent gap. Check that invite links are random and expire, that they can be accepted only by the email address they were sent to, that they cannot be reused, and that accepting an invite cannot place the user into a different organization. When someone is removed, their sessions, tokens and invitations should stop working at once.
Account deletion should also be tested. A deleted account should not be able to sign in, and its data should be removed or anonymized according to your policy.
Authentication Checklist
| Flow | Check | How to verify |
|---|---|---|
| Sign-up | Unverified accounts cannot do sensitive actions | Create an account and try to invite or pay |
| Login | Repeated failures are throttled | Send wrong passwords for one account |
| Login | Errors do not reveal accounts | Compare responses for real and fake emails |
| Reset | Links expire and are single use | Reuse and wait past expiry |
| Reset | Changing password ends other sessions | Check an old session after the change |
| Email change | Confirmed and notified | Change the email, check the old address |
| MFA | Cannot be skipped | Call the step after password directly |
| Sessions | Logout and timeout end the session | Replay the old cookie |
| Cookies | Secure, HttpOnly and SameSite set | Inspect Set-Cookie headers |
| Tokens | Revocable and checked on each request | Revoke, then use the token |
| OAuth | State and redirects validated | Tamper with the redirect and state values |
| Invitations | Single use and bound to the right email | Accept with a different address |
How to Test Authentication Like an Attacker
Work through each flow with the mindset of someone who does not have the password. Use a second account only as a victim, so you can prove the takeover without harming real users.
The practical method is to try the attack, not only to read the configuration. Send repeated logins, request resets for accounts you own and for made-up addresses, replay tokens, change the password and watch what survives. Record each request and response, because a useful finding always has evidence. Our guide to OWASP Top 10 explained places these failures under identification and authentication.
Where Hetz Fits
Hetz tests authentication as part of an automated run on your live product. You provide test accounts, and agents attempt the flows above as an outsider and as a user of another account, keeping only the attacks they can prove. Each finding includes the request and response, a fix for your stack and a retest once the change is live. If your product is built on a SaaS model with many accounts and invitations, see our SaaS penetration testing page.
Next steps
Pick one flow this week, starting with password reset, and run the checks above against it. Fix what fails, then repeat the same requests to prove the fix. After that, schedule a full test that covers every flow before your next release. You can see how a run is scoped on the home page, compare plans on pricing, or start a scan.
FAQ