OAuth 2.0, OIDC & SAML SSO Penetration Testing Guide
Manual penetration testing for OAuth 2.0, OpenID Connect, and SAML 2.0 SSO: redirect_uri bypass, CSRF state flaws, signature wrapping, and MFA bypass.
Web & App Security · By Thimmagurudu Bathini, CTO · Published · 6 min read
Why Custom SSO Integrations Break Secure Protocols
Single Sign-On implementations rarely fail because OAuth 2.0 or SAML 2.0 specifications are broken—they fail because custom service-provider code skips state checks, accepts loose redirect URIs, or trusts unverified email claims. Manual protocol-aware testing is essential for any app supporting Google, Microsoft Entra ID, or Okta login.
GET /oauth/authorize?client_id=app_123&response_type=code
&redirect_uri=https://app.example.com.attacker.test/cb
&state=static_or_missing
# Secure IdP: rejects with invalid_redirect_uri; requires exact match + PKCETesting Redirect URIs, State & XML Signatures
- Test redirect_uri validation with subdomain prefixes, @ symbols, path traversal, and open redirects on whitelisted domains.
- Verify that state and PKCE code_verifier are bound to the user's browser session and expire after one use.
- Inspect SAML assertions for signature enforcement on the Assertion vs. Response element and strict AudienceRestriction checks.
- Confirm that step-up MFA enforced by the IdP cannot be bypassed via direct API calls.
OAuth 2.0, OIDC & SAML Flaws Ranked by Impact
| Protocol | Common Vulnerability | Impact |
|---|---|---|
| OAuth 2.0 | Loose redirect_uri wildcard or path traversal | Authorization code or access token theft |
| OAuth / OIDC | Missing or predictable state / PKCE parameter | Login CSRF linking attacker's IdP to victim account |
| SAML 2.0 | XML signature wrapping (XSW) or missing recipient check | Full authentication bypass as any tenant user |
| Enterprise SSO | Auto-linking unverified email claims across IdPs | Pre-hijacking accounts before victim signs in |
Applying RFC 9700 Hardening Controls
Follow RFC 9700 OAuth 2.0 Security Best Current Practice: require exact redirect_uri matching, mandatory PKCE, and verified email claims before account linking.
From the Field: Domain-Suffix Bypasses on Enterprise SSO
Custom OAuth and SAML handlers often validate redirect URIs with substring or prefix checks rather than exact URL matching. During manual testing, we regularly catch wildcard or suffix bypasses and missing state parameters that let an attacker link their IdP session to a victim's workspace.
Test your OAuth 2.0, OIDC, and SAML SSO workflows manually from ₹36,000 + 18% GST. Request a scoped proposal →
OAuth & SAML Pentest Questions
Do automated scanners catch OAuth or SAML flaws?
Rarely. Scanners cannot complete multi-step IdP redirects or craft valid XML signature-wrapping payloads.
Is SSO testing included in web app VAPT?
Yes—authenticated web application scopes from ₹36,000 + 18% GST cover login, OAuth/OIDC, and SAML flows.