hermes

Review an authentication flow

Reviews an authentication or session design (OAuth or OIDC, tokens, cookies, MFA, password reset) for known flaws, with attack paths and fixes. Use before building or shipping login and session code.

context

Authentication bugs are rarely in the cryptography. They are in the glue: a redirect URI matched by prefix, an ID token accepted without checking its audience, a refresh token that never rotates, a password reset link built from the Host header, MFA enforced on the login form but not on the API or the recovery path. Each has a well-known attack. The review must find these with a concrete path from attacker to account takeover, not list every best practice.

task

Review this authentication design for a application:

Check each area that the material covers:

  1. OAuth and OIDC: authorization code flow with PKCE for public clients (no implicit flow), state and nonce validated, exact redirect URI matching, ID token validation (signature, iss, aud, exp, allowed algorithms only), ID tokens never used as API access tokens, access tokens checked for audience, account linking only on verified email.
  2. Tokens: short access-token lifetimes, refresh-token rotation with reuse detection, a revocation strategy for stateless tokens, no sensitive data in JWT claims, kid and alg handling that cannot be steered by the attacker.
  3. Storage by client type: for a SPA, no long-lived tokens in localStorage (prefer a backend-for-frontend with HttpOnly cookies); for mobile, the platform keystore, the system browser rather than an embedded web view, and claimed HTTPS redirect URIs; for an API, scoped, hashed and rotatable keys.
  4. Sessions and cookies: new session ID on login and privilege change, Secure, HttpOnly, SameSite and the __Host- prefix, idle and absolute timeouts, server-side invalidation on logout and password change, CSRF protection for cookie-authenticated state changes.
  5. Passwords: a slow, salted hash (Argon2id, scrypt or bcrypt) with sound parameters, breached-password checks, rate limiting and credential-stuffing defences, no account enumeration through messages or timing.
  6. Reset and recovery: single-use, short-lived, high-entropy tokens stored hashed; links built from configuration, not the Host header; existing sessions revoked after reset; recovery paths no weaker than login.
  7. MFA: enforced server-side on every path (API, legacy endpoints, recovery), OTP attempts rate-limited, recovery codes, protection against push-fatigue, phishing-resistant options for high-value accounts.

Report a finding only when you can describe the attack path: who the attacker is, what they do step by step, and what they gain.

constraints
  • Quote the line, setting or diagram step each finding is about. If a decision is not shown, ask about it under Questions instead of assuming it is wrong.
  • Rank by impact: account takeover and token theft first, hardening last.
  • Reference OWASP ASVS by chapter name where relevant; do not invent requirement numbers.
  • Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
  • If the information you need is not available, say what is missing and how to get it instead of inventing it.
output format

Verdict

One line: ship | ship after fixes | redesign needed. Then one sentence why.

Findings

Numbered. Each: severity, location, the attack path in steps, the impact, and the fix.

Verified safe

Bullets of areas you checked and found sound.

Questions

Decisions the material does not show that change the risk.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Security
level
Expert
made for
Security engineer, Backend engineer, Full-stack engineer, Software architect
risk
read-only
version
v1.0.0 · incubating
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md, ChatGPT, claude.ai

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install review-auth-flow --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill review-auth-flow -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Security
PersonaSecurity

Security auditor

Reviews code for exploitable weaknesses and reports only issues with a concrete attack path. Use as a reviewer persona or subagent for security-sensitive changes.

security-auditor
PromptSecurity

Respond to a leaked secret

Produces an ordered response plan for an exposed key, token or password - revoke and rotate, audit use, clean up copies, notify and prevent. Use right after a secret is committed, logged or shared.

respond-to-leaked-secret
PromptSecurity

Review an API against the OWASP API Top 10

Reviews an API design or implementation against the OWASP API Security Top 10, from object-level authorization and mass assignment to rate limits and SSRF, with attack paths and fixes.

review-api-security
PromptSecurity

Review a cloud IAM policy

Reviews AWS, GCP or Azure IAM policies for over-broad permissions, privilege-escalation paths, wildcard resources and missing conditions, and proposes least-privilege versions.

review-cloud-iam-policy
PromptSecurity

Review a pull request for security

Reviews a diff for exploitable vulnerabilities and reports only findings with a concrete attack path. Use before merging changes to input handling, auth, data access or dependencies.

review-pr-for-security
PromptSecurity

Threat model a feature

Builds a threat model for one feature or change, mapping data flows and trust boundaries to ranked threats and mitigations. Use during design, before the code is written or merged.

threat-model-feature