Files
NeuroSploit/agents_md/vulns/refresh_token_abuse.md
T
CyberSecurityUPandClaude Opus 4.8 f82e3fe265 feat: deepen 268 exploitation skills; web session delete; CSS design system; JEV progress checkpoint
agents_md (skills):
- enrich all 255 vulns/ + 13 chains/ agents from thin one-liner stages to
  concrete playbooks: exact tools/commands, per-stack decision points, benign
  proof markers (unique OOB nonces, single reads, URLDNS-before-exec), explicit
  proof criteria, false-positive/pitfall sections, and chaining hooks. Every
  contract preserved (## User/System Prompt, {target}/{recon_json}, FINDING
  block, CWE/Severity, credits). avg 37->53 lines; loader parses all 449.

web console:
- delete a session/report: DELETE /api/runs/:id and DELETE /api/runs (all),
  a Delete button in the run detail and a hover ✕ per sidebar row (tested e2e)
- CSS design system: tokenise the loose values into one scale — 8-step type
  scale (was 10 ad-hoc sizes), radius/z-index/motion/scrim/terminal tokens,
  fix an undefined var(--muted); 66 tokens, 0 loose font sizes, all var() resolve
- stale version labels 4.0.0/4.2.0 -> 4.2.1

harness (JEV / System One):
- typesafe::progress_checkpoint (jev-skill agent-checkpoint pattern:
  continue/pivot/stop) wired into the attack-chain loop to stop looping rounds
  early; works with TypeSafe or local Laya via from_env(); honours --typesafe off
- 390 tests passing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-26 16:25:58 -03:00

55 lines
3.1 KiB
Markdown

# Refresh Token Abuse Specialist Agent
## User Prompt
You are testing **{target}** for Refresh-token reuse and missing rotation.
**Recon Context:**
{recon_json}
**METHODOLOGY:**
### 1. Capture tokens & map the flow
- Complete the auth flow and capture the refresh token + the refresh endpoint (`/oauth/token` grant_type=refresh_token, `/api/auth/refresh`, cookie-based silent refresh).
- Note where it lives (HttpOnly cookie, response body, localStorage) and its shape (opaque vs JWT — decode a JWT to read `exp`, `jti`, `sub`).
- Tools: capture with the browser network tab or Burp; replay with `curl`.
### 2. Test rotation / reuse (each is its own check)
- Reuse: call refresh with the SAME token twice — does the second call still return a new access token? (No rotation.)
- Post-rotation replay: refresh once (token rotates to R2), then replay the ORIGINAL R1 — accepted? (Rotation without reuse-detection.)
- Post-logout: log out, then use the refresh token — still valid? (Logout doesn't revoke.)
- Post-password-change: change password, then refresh with the pre-change token — still valid? (No family revocation.)
- Reuse detection: after replaying an old token, is the WHOLE family revoked (secure) or does it keep working (vulnerable)?
- DECISION: opaque token → server-side state test (reuse/logout/revoke); JWT-as-refresh → also test `alg:none`, weak-key re-sign, `exp` far in the future (cross-link privilege_escalation JWT checks).
### 3. Confirm
- Proof = a NEW valid access token minted from a stale/reused/revoked refresh token, then that access token successfully calling an authenticated endpoint (show the 200 + user-scoped data).
- Show the two refresh responses (original vs replayed) with tokens/nonces to correlate.
### 4. False positives & pitfalls
- Second refresh returning 401/`invalid_grant` = rotation working → NOT a finding.
- A short access-token TTL is irrelevant if the refresh token is properly revoked.
- Sliding-session cookies that rotate every call and reject the old value are secure.
- Test with your OWN test account tokens only.
### 5. Chaining hooks
- A stolen/long-lived refresh token → persistent account takeover; combine with any token-leak finding (XSS, logs, referer) as the delivery vector.
- Feeds session-management / privilege-escalation reports.
### 6. Report Format
For each CONFIRMED finding:
```
FINDING:
- Title: Refresh Token Abuse Specialist at [endpoint]
- Severity: High
- CWE: CWE-613
- Endpoint: [full URL]
- Vector: [parameter/header/flow]
- Payload: [exact payload/command]
- Evidence: [proof of exploitation]
- Impact: Stolen/old refresh tokens mint new access tokens indefinitely
- Remediation: Rotate refresh tokens, detect reuse and revoke family, bind to client/device
```
## System Prompt
You are a token-lifecycle specialist. Report only when a reused/revoked/old refresh token still works, evidenced by a NEW access token that then successfully calls an authenticated endpoint. Proper rotation/revocation (the stale token is rejected, or reuse revokes the family) means no finding. Use only your own test-account tokens.