Use when you need to review authentication, sessions, cookies, tokens, origins, and permission assumptions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skillry-backend-and-api:14-auth-session-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill reviews the authentication and session management layer of a web application for the concrete vulnerabilities that most commonly appear in production codebases: weak cookie flags, JWT misconfiguration, missing CSRF protection, password hashing with outdated algorithms, session fixation, and broken token rotation. It produces a prioritized list of findings with specific remediation st...
This skill reviews the authentication and session management layer of a web application for the concrete vulnerabilities that most commonly appear in production codebases: weak cookie flags, JWT misconfiguration, missing CSRF protection, password hashing with outdated algorithms, session fixation, and broken token rotation. It produces a prioritized list of findings with specific remediation steps.
Locate all session/token creation points. Search for: jwt.sign(, session.create(, res.cookie(, createToken(, generateSession(. List every place a session or token is issued. These are the primary attack surface.
Audit cookie flags on session and auth cookies. For every res.cookie(name, value, options) call, verify:
HttpOnly: true — prevents JavaScript access, mitigates XSS-based session theftSecure: true — prevents transmission over plain HTTP; must be enabled in productionSameSite: 'Strict' or 'Lax' — 'None' requires explicit justification (cross-origin embedding)Path: '/' and Domain scoped to the minimum necessarymaxAge or expires set — no session cookie should be indefinitely valid
Example of a correct session cookie: res.cookie('sid', token, { httpOnly: true, secure: true, sameSite: 'Lax', maxAge: 3600000 }).HS256 or better, never none — look for { algorithm: 'none' } or missing algorithms in jwt.verify() options.jwt.verify() is called with an explicit algorithms whitelist: jwt.verify(token, secret, { algorithms: ['HS256'] }).exp) is set and short (15-60 minutes for access tokens).Check for session fixation vulnerabilities. After a successful login, a new session ID must be generated — the pre-login session ID must not be reused. Search for: req.session.userId = user.id without a preceding req.session.regenerate() call (Express-session). Session fixation allows an attacker to plant a known session ID and then hijack the session after the victim logs in.
Verify CSRF protection on state-changing requests. For cookie-based sessions: confirm a CSRF token is validated on all POST/PUT/PATCH/DELETE endpoints, or SameSite=Strict/Lax is set on the session cookie (which provides CSRF protection in modern browsers). For JWT in Authorization header: CSRF is not a risk because cookies are not automatically sent. Look for: no csurf / csrf middleware, or CSRF middleware configured with ignoreMethods: ['POST'] (a footgun).
Review password hashing. Find all places where passwords are hashed (registration, password reset). Verify:
bcrypt (cost factor ≥ 12), argon2id (recommended), or scrypt — never md5, sha1, sha256 without a proper KDF.bcrypt.compare() is used for verification (timing-safe), not bcrypt.hash(input) === storedHash.crypto.randomBytes(32), not Math.random()).console.log, logger.info, logger.debug calls in auth-related files and confirm they do not log: full JWTs, session IDs, passwords (even hashed), or API keys.HttpOnly, Secure, SameSite flagsmaxAge set — no indefinitely-valid session cookiesverify() — none is impossiblereq.session.regenerate() called after login (session fixation prevention)crypto.randomBytes, stored hashed, expire in ≤ 60 minalgorithms whitelist in jwt.verify(): without { algorithms: ['HS256'] }, a crafted token can specify alg: none and bypass signature verification entirely.Report must include:
regenerate() is called after loginalg: none JWT findings and missing password hashing as critical and surface them immediately before completing the rest of the review.npx claudepluginhub fluxonlab/skillry --plugin skillry-backend-and-apiProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.