Api auth attacks

From NoorQureshi/security-skills · View interactive version

Api auth attacks is an AI agent skill from the GitHub repository NoorQureshi/security-skills. Break API authentication: token handling, key leakage, weak session/JWT, and no-auth endpoints. Load on REST/GraphQL APIs using API keys, Bearer tokens, HMAC signing, or basic auth. Signals: `Authorization` headers, api_key params, tokens in URLs, /v1 vs /v2 auth drift.

How to use this skill

Skill file

API authentication attacks

When it applies

An API authenticates requests via tokens/keys/sessions. Auth is the gate; weaknesses here open

everything behind it.

Why it works

APIs sprawl (many endpoints, versions, clients) so authentication is applied inconsistently:

some routes forgot it, tokens are long-lived or weakly signed, keys leak client-side, and

error/timing differences enable enumeration and brute force.

Method

  1. No-auth endpoints: replay requests with the token removed; probe /v1 vs /v2,

/internal, /debug, and undocumented routes (Swagger/OpenAPI) for missing auth.

  1. Token weaknesses: JWT issues (→ web-auth-jwt: alg confusion, weak secret, none); long/

non-expiring tokens; predictable session ids; token accepted in URL (logged/leaked).

  1. Key leakage: hunt keys in JS bundles, mobile apps, git (→ code-review-secrets-detection),

and test their privilege/scope.

  1. Brute/enumeration: username enumeration via login/reset differences; weak rate limits on

login/OTP (→ web-race-conditions for OTP windows).

  1. Auth logic: password reset token predictability/leak, 2FA bypass, "remember me" tokens.

Gotchas

Verify success

Authenticated access without valid credentials (no-auth route, forged/replayed token, or a live

leaked key performing a privileged action).

References

OWASP API Security Top 10 (API2); PortSwigger auth labs.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.