/viperclaw:viper-auth-oauth-jwtfrom viperclaw
Audits JWT verification, OAuth 2.0/OIDC flows, and token security. Checks algorithm pinning, HMAC entropy, claim validation, and redirect_uri hardening against CWE-347, CWE-287, and OWASP ASVS V2/V3.
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-auth-oauth-jwt)viper_jwt_audit, viper_browser_ingest, viper_diff_oracle, viper_verify_and_reportviperclaw jwt "<token>" --output jwt_audit.jsonflowchart LR
Token["Incoming Bearer JWT / OAuth Code"] --> Header["Header Guard (Pin alg & kid)"] --> Crypto["Asymmetric / High-Entropy Verify"] --> Claims["Validate exp, iss, aud, sub"]
Authentication gaps arise when JWT libraries trust the token's own header (alg, kid, jku, jwk) to select the verification key or algorithm, or when OAuth account-linking flows trust unverified email addresses or loosely matched redirect_uri values.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw jwt "<token>" --output jwt_audit.json
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(jwt\.decode|jwt\.verify|jsonwebtoken|Jose\.JWT|NimbusJwtDecoder)"
rg -n "(verify_signature\s*:\s*False|options\s*=\s*\{.*verify_signature)"
rg -n "(redirect_uri|client_secret|response_type|code_verifier)"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
AUTH-01 | Explicit JWT Algorithm Pinning | Verification call hardcodes algorithms=["RS256"] (or ES256/EdDSA); never reads header.alg dynamically. | alg: none accepted or RS256 public key usable as HS256 HMAC secret. |
AUTH-02 | HMAC Secret Entropy (>= 256 bits) | Symmetric HS256 keys generated via CSPRNG (>= 32 random bytes), never dictionary words. | Weak secret (secret, changeme, app name) recoverable offline via viperclaw jwt. |
AUTH-03 | Untrusted Header Parameters (kid, jku, jwk) | kid matched against a strict alphanumeric allowlist of server-configured key IDs; jku/x5u/jwk ignored. | kid passed into file path (../../../../dev/null) or SQL query. |
AUTH-04 | Mandatory Claim Validation (exp, iss, aud) | Verifier enforces require=["exp", "iss", "aud", "sub"] with bounded clock skew. | Tokens without exp never expire, or tokens from a staging/sibling service (aud mismatch) are accepted. |
AUTH-05 | Pre-ATO Email Collision Prevention | Linking an OAuth provider to an existing password account requires email_verified === true AND re-authentication if the email wasn't previously verified. | An unverified account can be pre-registered before a user signs up with Google OAuth and retains active session. |
AUTH-06 | Password Reset Token Security | Reset tokens are >= 128-bit CSPRNG, hashed (SHA-256) at rest in DB, expire in <= 15m, and are single-use. | Predictable UUIDv1/timestamp reset tokens or tokens not invalidated after use. |
AUTH-07 | Account Enumeration Resistance | Login, registration, and password-reset endpoints return uniform response messages and status codes (using dummy bcrypt verify on missing users). | Login returns "User not found" vs. "Wrong password" or 2ms vs. 250ms timing difference. |
AUTH-08 | Token Type Separation (Access vs. Refresh) | Refresh tokens cannot be used as Bearer access tokens on API endpoints (typ / token_use claim checked). | Long-lived refresh token accepted directly by auth middleware as an access token. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.8) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | Weak JWT HMAC secret, alg:none acceptance, or unvalidated kid path resolution allowing admin impersonation. |
| HIGH (8.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N | OAuth redirect_uri validation gap or Pre-ATO unverified email collision leading to account takeover. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N | Missing exp / aud validation or observable username enumeration on login. |
# ❌ VULNERABLE: Trusts unverified header alg, uses weak secret, and skips aud/iss checks
def verify_user_token(token: str) -> dict:
hdr = jwt.get_unverified_header(token)
return jwt.decode(token, key="secret123", algorithms=[hdr["alg"]])
# ✅ HARDENED: Pins asymmetric algorithm, allowlists kid, and enforces exp/iss/aud claims
ALLOWED_KIDS = {"prod-rs256-2026-01": PUBLIC_KEY_PEM_2026}
def verify_user_token(token: str) -> dict:
hdr = jwt.get_unverified_header(token)
kid = hdr.get("kid")
if hdr.get("alg") != "RS256" or kid not in ALLOWED_KIDS:
raise ValueError("Untrusted JWT algorithm or key ID")
return jwt.decode(
token,
key=ALLOWED_KIDS[kid],
algorithms=["RS256"],
issuer="https://auth.example.com",
audience="https://api.example.com",
options={"require": ["exp", "iat", "iss", "aud", "sub"]},
)
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