Authentication & Session Security

Authentication & Session Security

Authentication decides who someone is; session management decides how long they stay trusted. Flaws here are high impact because they lead straight to account takeover. Many are configuration-level and quietly shipped by default: tokens that never expire, cookies missing security flags, or login endpoints with no rate limiting.

Missing Session Expiry & Rotation

CWE-613OWASP ASVS 3.3
What it is
Sessions have no absolute or idle timeout, or are not rotated when privileges change, so a captured session stays valid indefinitely.
Why it matters
A stolen or fixated session grants long-lived access and survives password changes.
How to check
Set absolute and idle timeouts, and rotate the session id on login and privilege change.

Insecure JWT Handling

CWE-347
What it is
Tokens accept the none algorithm, use a weak secret, or are not validated for expiry, audience, and issuer.
Why it matters
Attackers forge or extend tokens and impersonate any user.
How to check
Pin the algorithm, use a strong secret or asymmetric keys, and verify exp, aud, and iss on every request.

No Brute-Force Protection

CWE-307
What it is
Login, reset, or token endpoints have no rate limiting or lockout.
Why it matters
Credential stuffing and password guessing at scale.
How to check
Rate-limit authentication endpoints and add progressive delays or lockouts.

Account Enumeration

CWE-204
What it is
Login or password-reset responses differ depending on whether an account exists.
Why it matters
Attackers build valid account lists to target with phishing and credential stuffing.
How to check
Return identical responses and timing whether or not the account exists.

In-depth guides

Related coverage

Check your code for authentication & session security

Tethlyn Audit checks your codebase for authentication & session security and more, then ranks each finding by real exploitability and data sensitivity.

See Tethlyn Audit