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 email as 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

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 UNION row 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 for user_id 1 gave admin (VulnCheck); @tensei/auth ≤0.11.5 (CVE-2026-129552, CWE-1394) fell back to auth-secret-key when JWT_SECRET was unset (VulnCheck). See Hardcoded Secrets, JWT Secret Cracking.
  • JWT algorithm confusion: RS256 verifiers that let the token’s alg choose HMAC accept tokens signed with the public key from /jwks.json as the HMAC secret (lab writeup); an unpinned API-gateway check paid $4,500 for guest-to-admin (writeup). Survey of none, key confusion, kid traversal/SQLi, jwk/jku injection 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 login mutations, each returning success (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 state was 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/token with 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_api GraphQL template mutations unauthenticated; injected HTML rendered by headless Chromium in generateContractPDF pulled 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, HttpOnly refresh cookies and DPoP binding limit what a stolen token buys (Moorthy). See JWT Claim Validation Failures, JWT Token Lifecycle and Revocation.
  • Client side: a postMessage XSS plus a no-old-password “set password” flow for Google/Apple accounts gave Chess.com ATO (XENOPS).

Testing quick start

  1. 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.
  2. For each multi-step flow, confirm that later steps verify earlier ones happened for this user in this browser.
  3. For federated login, find which claim keys the account (iss+sub vs email), and how the app validates signature, audience and binding (state, nonce, InResponseTo).
  4. 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).
  5. Check the session lifecycle: rotation at login and privilege change, and revocation on logout, password change and reset.
  6. 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)

Sources