Authentication Vulnerabilities: The Complete Practical Guide
Other Authentication Mechanisms: SSO, Social Login, and Logout
Authentication edges beyond the login form: SSO handoff trust, social-login email collision, keep-me-logged-in gaps, and logout that fails to invalidate.
Published
Not every authentication flaw lives in the login form. Single sign-on handoffs, social logins, "keep me logged in" shortcuts, and logout all carry their own trust assumptions, and each can be the weak link that an otherwise solid login does not protect. This page covers the edges. Practice the full picture on a free live target.
SSO and federated handoffs
Single sign-on delegates authentication to an identity provider and hands the result back to the application. That handoff is a trust boundary, and two things commonly go wrong at it.
Unvalidated return URL. The SSO flow carries a parameter telling the app where to send the user after authentication. If that destination is not strictly validated against an allow-list, it becomes an open redirect in the middle of a login, which can leak the authentication response (a code or token in the URL) to an attacker-controlled destination. Treat any redirect_uri, returnUrl, or next parameter in an auth flow as a validation target.
Assertion replay. The identity provider returns a signed assertion (a SAML response or an OAuth token) that proves who the user is. If the application does not check that the assertion is fresh, bound to this request, and not already used, a captured assertion can be replayed to authenticate again. The defenses are signature verification, a short validity window, an audience restriction, and a one-time nonce, and a flow missing any of them is worth probing.
A deeper treatment of token-level attacks lives in JWT attacks, since the assertions and tokens that flow through SSO are frequently JWTs, and everything about forging and verifying them applies here.
Social-login email collision
Social login (sign in with a major provider) usually links the external identity to a local account by email address. The takeover happens when the app trusts that email without confirming the provider actually verified it, or auto-merges a social identity into an existing password account by email alone. An attacker registers with the provider using the victim's email, completes social login, and lands in the victim's account. The fix is to require a provider-verified email and to confirm any account linking out-of-band rather than on the address by itself.
Keep-me-logged-in and step-up gaps
"Keep me logged in" and long-lived sessions are convenient and routinely skip re-authentication where it matters. The pattern to look for: a sensitive action (changing the email, changing the password, viewing payment details) that should demand the current password or a fresh factor, but accepts a long-lived session instead. Step-up authentication exists precisely so that a persistent session is not enough to perform account-critical actions, and when it is not enforced, a stolen or forged persistent cookie (see session attacks) escalates straight to full control.
Logout that does not log out
Logout is an authentication control, and it fails quietly. If logout only deletes the cookie client-side without invalidating the session on the server, the old token still authenticates. Anyone who captured it keeps access after the user believes they signed out, which matters on shared machines and anywhere a token may have leaked. Test it directly: capture a session token, log out, and replay the token. If it still works, logout is cosmetic.
Putting the edges together
What unites these is misplaced trust at a boundary: trusting a redirect target, a provider's unverified claim, a long-lived session, or a client-side logout. None of them is the login form, and all of them can hand over an account that the login itself protected well. When you assess authentication, walk every path in and out of the authenticated state, not just the password prompt.
Fixing it
- Strictly allow-list every redirect target in an auth flow, and verify SSO assertions for signature, freshness, audience, and single use.
- Require a provider-verified email for social login and confirm account linking out-of-band.
- Enforce step-up re-authentication before sensitive actions, regardless of how long the session has been alive.
- Invalidate the session server-side on logout so the token is dead everywhere, not just cleared locally.
Full defensive detail is in securing authentication. For every signal and payload in one place, see the cheat sheet, or test these edges on a free lab.
← Back to Authentication Vulnerabilities: The Complete Practical Guide