/viperclaw:viper-oauth-oidc-compliancefrom viperclaw
Audits OAuth 2.1, OIDC, and SSO implementations for compliance with RFC 9700 security best practices. Checks PKCE S256 enforcement, redirect_uri matching, state/nonce binding, token audience, and SAML XML signature wrapping.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-oauth-oidc-compliance)viper_jwt_audit, viper_taint_scan, viper_verify_and_reportviperclaw taint ./src --db .viperclaw/graph.dbflowchart LR
Client["Client App (PKCE S256 + state)"] --> AS["Authorization Server (Exact redirect_uri)"] --> Exchange["Back-Channel Code Exchange"] --> Verify["Verify iss, aud, exp, nonce, email_verified"]
OAuth and OIDC implementations fail when Authorization Servers use prefix/wildcard matching on redirect_uri (allowing code leakage via open redirects or path traversal), omit mandatory PKCE (S256) and session-bound state parameters, or trust OIDC email claims without checking email_verified === true and aud.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(authorize_redirect|fetch_token|code_challenge|code_verifier|redirect_uri)"
rg -n "(response_type=token|verify_id_token|oauth2|oidc)"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
OIDC-01 | Exact Byte-for-Byte redirect_uri Matching | Authorization Server compares redirect_uri using exact string equality against pre-registered URIs (no wildcards, regexes, or open-redirect chains). | redirect_uri.startswith('https://app.example.com') allows https://app.example.com.evil.tld or /../open-redirect. |
OIDC-02 | Mandatory PKCE (S256) Enforcement | Authorization code flow enforces code_challenge_method=S256 and rejects plain or missing code_verifier. | Authorization code exchangeable without code_verifier or downgradable to code_challenge_method=plain. |
OIDC-03 | Cryptographic Session-Bound state & nonce | state parameter is a CSPRNG token bound to the caller's browser cookie and consumed once on /callback; OIDC id_token verifies nonce. | Static/missing state parameter allowing OAuth Login CSRF or authorization code injection. |
OIDC-04 | Disable Legacy Implicit Flow (response_type=token) | Only Authorization Code + PKCE (response_type=code) is permitted; tokens are never returned in URL fragments. | response_type=token enabled, leaking access tokens in browser history and referrer contexts. |
OIDC-05 | Single-Use Short-Lived Authorization Codes | Authorization codes expire in <= 60 seconds, are single-use, and replaying a used code revokes all tokens issued from it. | Authorization code can be exchanged multiple times. |
OIDC-06 | OIDC ID Token iss, aud & email_verified Checks | Relying Party verifies JWKS signature, iss, aud == CLIENT_ID, exp, and email_verified is True before linking accounts. | Relying Party links account by email claim without checking email_verified or aud. |
OIDC-07 | IdP Mix-Up Prevention (Multi-IdP Clients) | Clients supporting multiple OAuth/OIDC IdPs use distinct callback URLs per IdP or verify the iss parameter in the authorization response (RFC 9207). | Shared /oauth/callback trusts session state to determine which IdP issued the code. |
OIDC-08 | Referrer Suppression on /callback Page | The OAuth callback endpoint sets Referrer-Policy: no-referrer so ?code=... is never leaked via third-party subresources. | Callback page loads external analytics scripts with unsafe-url referrer policy. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N | Wildcard/prefix redirect_uri validation gap or unverified email_verified claim enabling 1-click Account Takeover. |
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N | Missing state parameter on OAuth account-linking flow allowing an external party to link their IdP to another user's account. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N | Missing PKCE (S256) enforcement or reusable authorization codes. |
# ❌ VULNERABLE: Prefix match on redirect_uri, no state verification, and no email_verified check
def oauth_callback(request):
if not request.args["redirect_uri"].startswith("https://app.example.com"):
abort(400)
claims = exchange_code_for_id_token(request.args["code"])
return login_user_by_email(claims["email"])
# ✅ HARDENED: Exact redirect_uri allowlist, single-use state check, PKCE verifier & email_verified check
ALLOWED_REDIRECT_URIS = {"https://app.example.com/oauth/callback"}
def oauth_callback(request):
expected_state = session.pop("oauth_state", None)
pkce_verifier = session.pop("oauth_pkce_verifier", None)
if not expected_state or not hmac.compare_digest(expected_state, request.args.get("state", "")):
abort(403, "Invalid OAuth state")
redirect_uri = request.args.get("redirect_uri", "")
if redirect_uri not in ALLOWED_REDIRECT_URIS:
abort(400, "Untrusted redirect_uri")
claims = exchange_code_for_id_token(request.args["code"], redirect_uri=redirect_uri, code_verifier=pkce_verifier)
if not claims.get("email_verified"):
abort(403, "Email address is not verified by identity provider")
return login_user_by_email(claims["email"])
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job