Broken Authentication (OWASP API2) — weak token issuance/validation, API keys in URLs, tokens that never expire, missing lockout/rate-limit on auth, weak password reset, and session not invalidated. Tier 1. Cross-references jwt and oauth skills. Use whenever an API has login, tokens, API keys, OTP/2FA, or password reset.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Api Broken Auth?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-api-broken-auth)
---
name: api-broken-auth
description: Broken Authentication (OWASP API2) — weak token issuance/validation, API keys in URLs, tokens that never expire, missing lockout/rate-limit on auth, weak password reset, and session not invalidated. Tier 1. Cross-references jwt and oauth skills. Use whenever an API has login, tokens, API keys, OTP/2FA, or password reset.
---
# API2 — Broken Authentication
Attack how identity is proven and tokens are issued/validated. Flaws here yield account takeover. Payloads: `${CLAUDE_PLUGIN_ROOT}/payloads/auth-jwt.md`.
## Trigger phrases
`api2, broken authentication, api key, token expiry, credential stuffing, password reset, otp brute force, session invalidation, weak auth`
## Method
1. **Token issuance/validation** — decode every token (JWT? opaque?). For JWTs run the full `jwt` skill (alg:none, weak secret, jwk/jku/kid, RS256→HS256). Opaque tokens: test entropy, replay, cross-tenant acceptance.
2. **No expiry** — reuse a token long after issue / after logout / after password change; if still valid → broken session lifecycle. Test `exp`/`aud`/`iss` enforcement.
3. **API keys in the wrong places** — grep JS/APK/git/URLs for keys; test a key with no scoping, no rotation, valid across environments, and whether a **missing** key still grants access.
4. **Credential stuffing / brute-force** — probe login, OTP, and 2FA for missing rate limit/lockout:
```bash
ffuf -u https://TARGET/api/login -X POST -d '{"user":"admin","pass":"FUZZ"}' \
-H 'Content-Type: application/json' -w rockyou.txt -mc 200 -fr "invalid"
```
bypass limits: rotate `X-Forwarded-For`/`X-Real-IP`, GraphQL alias/batch, JSON-RPC batch (see `api-resource-consumption`).
5. **Password reset** — token predictability/short length/no expiry/reuse; **host-header poisoning** of reset links (`Host: attacker` → poisoned link to victim); reset-token leak via Referer.
6. **Session fixation / no invalidation** — token valid after logout or concurrent-session abuse.
## Bypass / evasion
Rate-limit evasion (headers, case/encoding, verb/version swap); naive filter bypass on `alg`; see `${CLAUDE_PLUGIN_ROOT}/payloads/waf-bypass.md`.
## Modern / rare techniques
- **[RARE] Key-in-URL** — API keys in query strings leak via logs/Referer/proxy history; flag as broken auth even if "working as designed".
- **[RARE] Pre-auth token acceptance** — endpoints that accept an unsigned/empty bearer or default service token.
- **[RARE] OTP/2FA response-based bypass** — status/flag in response controls success, or OTP returned in a sibling response; brute OTP via alias batching.
## Escalation / chaining
Account takeover → chain to `api-bola`/`api-bfla` with the victim/elevated identity. Weak reset → full ATO. Cross-ref `jwt`, `oauth`.
## Backend & tooling
Preferred Kali path (WSL+Kali / Kali-MCP / HexStrike); jwt_tool/hashcat for token crypto. Route through Burp; send manual PoCs to Repeater. See `zazy-orchestrator`.
## Verification (background, before reporting)
Reproduce auth bypass/ATO in a clean session; for rate-limit absence show sustained attempts without lockout. Confirm forged/replayed tokens authenticate as the target. True positives only.
## Evidence
The auth flaw request/response, the forged/replayed/reset token authenticating as victim or surviving invalidation, impact + remediation (short-lived tokens, lockout, MFA, keys out of URLs).