/viperclaw:viper-session-cookie-auditfrom viperclaw
Audits session lifecycle management including cookie hardening, session fixation defenses, and token revocation per OWASP ASVS V3. Reviews session ID rotation, server-side logout, and cookie security flags.
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-session-cookie-audit)viper_fingerprint_traffic, viper_browser_ingest, viper_verify_and_reportviperclaw fingerprint ./traffic.har --output session_audit.jsonflowchart LR
Login["User Login / Privilege Step-Up"] --> Regen["Rotate Session ID (Anti-Fixation)"] --> Cookie["__Host-Session (Secure; HttpOnly; SameSite)"] --> Revoke["Server-Side Revocation on Logout/PW Reset"]
Applications issue stateless tokens or client-side cookies without server-side revocation lists, fail to rotate session IDs on login (Session Fixation), or leave existing sessions active after a user changes their password or resets MFA.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw fingerprint ./traffic.har --output session_audit.json
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(session\.regenerate|request\.session\.cycle_key|migrate_session)"
rg -n "(SESSION_COOKIE_SECURE|SESSION_COOKIE_HTTPONLY|SESSION_COOKIE_SAMESITE|__Host-)"
rg -n "(logout|revoke_token|blacklist|delete_cookie)"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
SESS-01 | Session ID Rotation on Authentication | Session identifier is regenerated (req.session.regenerate(), cycle_key()) upon login and privilege elevation. | Pre-login anonymous session ID is retained after authentication (Session Fixation, CWE-384). |
SESS-02 | Server-Side Logout & Revocation | POST /logout deletes the session record from Redis/DB on the server, not just clearing the browser cookie. | /logout only sends Set-Cookie: session=; Max-Age=0 while the token remains valid on the server. |
SESS-03 | Invalidate All Sessions on Password/MFA Change | Changing password, resetting password, or disabling MFA revokes all other active sessions and refresh tokens for that user. | Previously issued sessions remain valid after the user resets their compromised password. |
SESS-04 | __Host- Cookie Prefix & Hardened Flags | Primary session cookie uses __Host- prefix with Secure; HttpOnly; Path=/; SameSite=Lax (no Domain attribute). | Cookie sets Domain=.example.com, allowing any compromised sibling subdomain to read or overwrite the session cookie (Cookie Tossing). |
SESS-05 | Idle & Absolute Session Timeouts | Sessions enforce both an idle timeout (e.g., 30m–2h for sensitive apps) and an absolute lifetime cap (e.g., 12h–7d). | Infinite session lifetime or refresh tokens that rotate indefinitely without an absolute cap. |
SESS-06 | Refresh Token Rotation & Reuse Detection | OAuth/JWT refresh tokens are single-use; replaying an already-rotated refresh token immediately revokes the entire token family. | Static refresh token reusable multiple times without rotation. |
SESS-07 | Concurrent Session Visibility & Revocation UI | Users can view active devices/sessions and revoke individual or all sessions from account settings. | No mechanism for users to terminate active sessions on lost/stolen devices. |
SESS-08 | Zero Session Tokens in URLs | Session IDs are never transmitted in URL query parameters (?sid=...) or logged in plaintext access logs. | Session token exposed in Referer headers or server access logs. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | Sessions/tokens remain valid after password reset or logout, or predictable session ID generation. |
| MEDIUM (6.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N | Session fixation (session ID not rotated on login) or subdomain cookie tossing via broad Domain attribute. |
| LOW (3.7) | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N | Missing HttpOnly/Secure flag or overly long idle timeout. |
# ❌ VULNERABLE: Only clears client cookie on logout; server session & sibling-subdomain Domain remain active
@app.post("/logout")
def logout():
resp = make_response({"status": "logged_out"})
resp.delete_cookie("session_id", domain=".example.com")
return resp
# ✅ HARDENED: Revokes session in server Redis store & uses __Host- prefix (no Domain attribute)
@app.post("/logout")
def logout(session: VerifiedSession):
redis_store.delete(f"sess:{session.session_id}")
resp = make_response({"status": "logged_out"})
resp.delete_cookie("__Host-session_id", path="/", secure=True, httponly=True, samesite="Lax")
return resp
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./viper-auth-oauth-jwtAuthentication, OAuth 2.0 / OIDC & JWT Security Auditor. Reviews token verification, algorithm allowlisting, claim validation, and OAuth redirect_uri configurations./viper-aws-iam-cloud-auditAWS IAM, STS, S3, KMS & Lambda Security Auditor (modeled on Prowler, Parliament & CloudSplaining). Reviews iam:PassRole escalation, STS ExternalId, S3 policies, and IMDSv2./viper-bola-idorObject & Function-Level Authorization (BOLA / BFLA) Audit Skill. Reviews resource access controls, tenant scoping, and ownership checks across API endpoints and controllers.Other plugins' skills for the same job