Authentication Security
Authentication flaws let an attacker get, or keep, a session as someone else. They usually come from a broken step in the identity flow (federation, second factor, recovery, session handling), not from guessing the password.
How it works
Every authentication system ends in one artifact: a session (cookie, bearer token or refresh token) that the application trusts to mean “this is user X”. Attacks target one of four places:
- The proof: the password, OTP, passkey assertion or federated assertion (ID token, SAML response) the application accepts. Typical failures are forgeable assertions, unvalidated claims and brute-forceable codes.
- The flow: the multi-step state machine around the proof, with skippable steps, unbound callbacks and race windows. OAuth is a delegation framework reused for login. Its spec is loose and most of its security controls are optional, so implementations get it wrong (PortSwigger).
- The side doors: password reset, account recovery, email change, account linking and fallback methods. Each must be as strong as primary login, and often isn’t.
- The resulting session: theft, fixation, failure to rotate or revoke. A stolen token represents authentication that has already completed, so it bypasses MFA entirely (Talos).
Track record by protocol (SSO protocol survey):
- SAML has the worst record by volume and severity, with XML signature wrapping recurring in 2012, 2018 and 2024.
- OAuth flaws are mostly logic bugs: redirects, missing
state, code interception. - OIDC inherits OAuth’s flaws and adds ID-token validation failures.
Single-factor authentication for remote or administrative access is now on CISA’s list of bad practices (The Record).
Map of the topic
Federation and SSO
- OAuth 2.0 Vulnerabilities: redirect_uri validation,
state/PKCE binding, code and token leakage, client and scope confusion, dynamic client registration. - OpenID Connect Security: ID-token validation, mutable claims and
emailas identifier, account linking, multi-IdP tenancy, cloud OIDC trust policies. - SAML Attacks: XML signature wrapping, parser and canonicalization differentials, signature exclusion, audience and replay checks.
- Token formats are covered in JSON Web Tokens (owned by jwt).
Factors
- MFA Bypass: skippable steps, unbound code checks, OTP brute force, non-MFA paths, SMS interception, downgrade.
- Passkeys and WebAuthn: the limits of origin binding, relying-party validation bugs, synced-passkey theft, fallback.
Recovery and sessions
- Password Reset Vulnerabilities: reset poisoning, token leakage and predictability, identity taken from the request, unauthenticated reset paths.
- Session Management: fixation, hijacking, cookie attributes and prefix bypasses, forgeable stateless sessions, revocation.
Identity-provider tradecraft
- Adversary-in-the-Middle Phishing: reverse-proxy kits that relay MFA and keep the session cookie.
- Device Code Phishing: the OAuth device authorization grant abused on the real IdP domain.
- OAuth Consent Phishing: malicious and second-party OAuth apps, and compromised integrations, used for persistence that survives password reset.
Outcome
- Account Takeover: the end state, and the chains that reach it (anchor changes, normalization, signing oracles, client-side and cache bugs).
Recent cases
Short pointers; mechanism detail lives on the linked pages.
- Login SQLi (XBEN-029): the username was concatenated into SQL; three distinguishable failure responses (unknown user, wrong password, success) acted as a boolean oracle, and a
UNIONrow was accepted as an administrator session. Fix: parameterized queries, real password-hash verification, uniform failure responses (B-52). See Union-Based SQL Injection. - VMware vCenter (CVE-2026-123890, CVSS 9.8, CWE-288): authentication bypass via an alternate path in VMware Directory Service gave unauthenticated Administrator access; exploited in the wild by ARMORY CASTLE from September 2026, distinct from CVE-2026-59309, no workaround (VMSA-2026-0009) (Rapid7).
- Hard-coded JWT secrets: BISHENG <3.0.0 (CVE-2026-130840, CWE-321) used a default
jwt_secret, so an offline-forged HS256 token foruser_id1 gave admin (VulnCheck);@tensei/auth≤0.11.5 (CVE-2026-129552, CWE-1394) fell back toauth-secret-keywhenJWT_SECRETwas unset (VulnCheck). See Hardcoded Secrets, JWT Secret Cracking. - JWT algorithm confusion: RS256 verifiers that let the token’s
algchoose HMAC accept tokens signed with the public key from/jwks.jsonas the HMAC secret (lab writeup); an unpinned API-gateway check paid $4,500 for guest-to-admin (writeup). Survey ofnone, key confusion,kidtraversal/SQLi,jwk/jkuinjection and claim checks (robinx0). See JWT Algorithm Confusion, JWT Header Injection, JWT None Algorithm. - Enumeration plus weak signing key: login timing and reset-response differences, an HS256 secret cracked to
intel, and sequential IDs chained to ATO (writeup). See Account Takeover. - GraphQL alias brute force: a rate limiter counting HTTP requests let one request carry 100 aliased
loginmutations, each returningsuccess(writeup). See GraphQL Batching Attacks. - Federated linking: Vikunja (CVE-2026-134284) and Better Auth (CVE-2026-134312) linked SSO logins to accounts via unverified emails (Vikunja, Better Auth); Seamless Auth’s signed
statewas not browser-bound (Seamless Auth). - Recovery: a reset token stayed valid after use (writeup); passkey recovery needs its own threat model (Radar Makers).
- Type confusion in token lookup: Xen Orchestra’s cookie parser turned
authenticationToken=j:{}into{}, which the token store treated as “match anything” and authenticated as the first unexpired token’s owner, often an admin (advisory). See Session Management. - Token endpoint without client authentication: Pomerium 0.30.0–0.33.x (CVE-2026-135300) redeemed intercepted codes and refresh tokens at
/.pomerium/mcp/tokenwith any client secret (advisory). MCP client registration is moving from DCR to Client ID Metadata Documents, which removes the open registration endpoint but makes the AS fetch attacker URLs (Auth0). See OAuth 2.0 Vulnerabilities. - Unbound callbacks (login CSRF): ZITADEL Login V2 < 4.20.3 and ByteStash < 1.6.1 (CVE-2026-134799) completed external-IdP/OIDC sign-ins in a browser that never started them (ZITADEL, ByteStash); better-auth (CVE-2026-134322) let an unverified phone number select the account at OTP sign-in, placing the victim in the attacker’s account (advisory). See Login CSRF, Account Takeover.
- Attempt counting: a JSON login accepted a password array and tried every element (writeup); Zimbra’s GraphQL auth endpoint (CVE-2026-93637) bypassed the SOAP login’s IP lockout counter (Rapid7).
- Missing authentication on a plugin API: erxes < 3.4.14 (CVE-2026-134826) exposed
insurance_apiGraphQL template mutations unauthenticated; injected HTML rendered by headless Chromium ingenerateContractPDFpulled internal content into PDFs (advisory). - Token validation: HashiCorp cap/jwt ≤ 0.13.0 (CVE-2026-19194) validated different claim values from those it returned (HCSEC-2026-60); refresh rotation,
HttpOnlyrefresh cookies and DPoP binding limit what a stolen token buys (Moorthy). See JWT Claim Validation Failures, JWT Token Lifecycle and Revocation. - Client side: a
postMessageXSS plus a no-old-password “set password” flow for Google/Apple accounts gave Chess.com ATO (XENOPS).
Testing quick start
- Map every path that issues a session: password login, each SSO/IdP, magic links, reset, MFA enrollment and recovery, mobile and legacy APIs, device flows, remember-me. The weakest path sets the security level.
- For each multi-step flow, confirm that later steps verify earlier ones happened for this user in this browser.
- For federated login, find which claim keys the account (
iss+subvsemail), and how the app validates signature, audience and binding (state,nonce,InResponseTo). - Check rate limiting on every guessable secret (password, OTP, reset code, backup code) across concurrency, IP rotation, batching (including GraphQL aliases) and alternate endpoints. The limit must count authentication attempts, not HTTP requests (writeup). Compare status, body and timing for unknown vs known accounts (Intel).
- Check the session lifecycle: rotation at login and privilege change, and revocation on logout, password change and reset.
- Check account-anchor changes (email, phone, MFA, linked identities): re-authentication, CSRF protection, notification.
Defenses (cross-cutting)
- MFA is the primary control against credential stuffing and password spraying. Add risk-based triggers, throttling and breached-password checks (OWASP Credential Stuffing).
- Require re-authentication for sensitive changes and after risk events such as recovery or a new device. Use generic responses on login, recovery and registration (OWASP Authentication).
- Session IDs need at least 64 bits of entropy, rotation on every privilege change, and idle plus absolute timeouts (OWASP Session Management).
- Prefer phishing-resistant, origin-bound credentials (FIDO2/passkeys), and remove weaker fallbacks for users who have them (FIDO Alliance, Talos).
- Pin the token verification algorithm and key per issuer or
kid; never let the token’s header choose them. Load signing secrets from configuration with no default fallback, and fail closed when unset (robinx0, Tensei). - Enforce the second factor server-side on every path (PortSwigger MFA).
Notable cases
- Virtualizor CVE-2026-135174: the email returned by a social-login IdP was used unsanitized in SQL, so an IdP account with SQL syntax in its email logged in as admin — treat IdP claims as untrusted input. (source)
Related
- Authorization Security: what happens after identity is established.
- JSON Web Tokens · Cross-Site Request Forgery · Login CSRF · API Security · Vulnerability Chaining · Bug Bounty Hunting
Sources
- OWASP Authentication Cheat Sheet · original
- OWASP Session Management Cheat Sheet · original
- OWASP Credential Stuffing Prevention Cheat Sheet · original
- SSO Protocol Security: Critical Vulnerabilities in SAML, OAuth, OIDC, JWT (2025) · original
- PortSwigger: OAuth 2.0 authentication vulnerabilities · original
- Cisco Talos: State-of-the-art phishing — MFA bypass · original
- FIDO Alliance: Passkeys overview · original
- Vulnerabilities in multi-factor authentication (PortSwigger) · original
- CISA adds single-factor authentication to its catalog of 'Bad Practices' · original
- A login bypassed by SQL injection: B-52 on XBEN-029 · original
- CVE-2026-123890: Critical Authentication Bypass in VMware vCenter · original
- BISHENG auth bypass via hard-coded JWT signing secret · original
- Tensei auth bypass via hard-coded JWT secret · original
- JWT authentication bypass via algorithm confusion · original
- How a JWT Algorithm Confusion Vulnerability Allowed a $4,500 Authentication Bypass · original
- JWT algorithm confusion: none, HS256/RS256 mix-ups, and kid injection · original
- Intel Inside: How a Cracked JWT Key led to Full Account Takeover · original
- Bypassing GraphQL brute force protections · original
- Vikunja account takeover vulnerability · original
- Better Auth OAuth signature issue (high) · original
- We wrote an RFC 9700 matrix and it found a bug (OAuth state binding) · original
- P2 Password Reset Token Not Invalidated After Successful Password Change · original
- Passkey Enrollment Is Easy to Celebrate. Recovery Is the Product. · original
- The Last Writer Wins: Chess.com account takeover via postMessage XSS · original
- Xen Orchestra: Empty-object login token · original
- Pomerium authentication bypass (critical) · original
- Registering MCP Clients with CIMD in Auth0 · original
- ZITADEL Login V2: external IdP callback not bound to browser (login CSRF) · original
- ByteStash login CSRF · original
- better-auth improper authentication · original
- Exploiting Broken Brute-Force Protection with Multiple Credentials per Request · original
- Metasploit Wrap Up: Breaking Zimbra's Identity Boundaries · original
- erxes insurance_api plugin missing authentication (GraphQL) · original
- HCSEC-2026-60: cap JWT claims validation bypass · original
- JWT Is More Than You Think: Refresh Tokens & DPoP · original
- Softaculous Virtualizor SQL injection (critical) · original