PluginBench
Skill
Fail
Audit score 45

api-auth-and-jwt-abuse

yaklang/hack-skills

Test JWT tokens, API keys, and auth headers for trust boundary weaknesses, claim abuse, and rate-limit bypasses.

What is api-auth-and-jwt-abuse?

Playbook for identifying and exploiting API authentication flaws in JWT, bearer tokens, and API keys. Use when testing token trust boundaries, claim misuse, header spoofing, and rate-limit bypass techniques.

  • Inspect JWT structure (alg, kid, jku, x5u) and privilege claims for trust issues
  • Test algorithm confusion attacks (alg:none, RS256→HS256 switching)
  • Identify kid lookup injection and remote key fetch vulnerabilities
  • Detect weak secrets and offline token cracking opportunities
  • Bypass rate limits using header spoofing (X-Forwarded-For, X-Real-IP, Forwarded)
  • Exploit batch/mass-assignment abuse in GraphQL and JSON APIs

How to install api-auth-and-jwt-abuse

npx skills add https://github.com/yaklang/hack-skills --skill api-auth-and-jwt-abuse
Claude Code
Cursor
Windsurf
Cline

How to use api-auth-and-jwt-abuse

  1. 1.Intercept API requests and extract bearer tokens or JWT tokens
  2. 2.Decode the JWT header and payload to inspect alg, kid, jku, x5u, and privilege claims
  3. 3.Test algorithm confusion by creating an unsigned token (alg:none) or switching RS256 to HS256
  4. 4.Attempt to inject or traverse the kid parameter to load alternative keys
  5. 5.Try rate-limit bypass headers (X-Forwarded-For, X-Real-IP, Forwarded) on rate-limited endpoints
  6. 6.Test batch/mass-assignment by sending arrays of mutations or repeated requests in a single payload
  7. 7.Attempt to crack weak secrets offline using targeted wordlists if token inspection reveals weak entropy

Use cases

Good for
  • Test a JWT endpoint for algorithm confusion by switching RS256 to HS256 with the public key as secret
  • Attempt rate-limit bypass by rotating X-Forwarded-For headers or User-Agent values
  • Check for mass-assignment vulnerabilities by injecting role, isAdmin, or permissions fields in API requests
  • Exploit GraphQL batch mutations to bypass authentication or rate limits on password reset endpoints
  • Inspect kid parameter in JWT headers for path traversal or injection leading to key confusion
Who it's for
  • API security testers
  • Penetration testers evaluating authentication boundaries
  • Bug bounty hunters targeting token-based auth systems
  • Security engineers auditing JWT and OAuth implementations

api-auth-and-jwt-abuse FAQ

What is the difference between alg:none and RS256→HS256 confusion?

alg:none removes signature verification entirely (unsigned token with trailing dot). RS256→HS256 confusion tricks the server into using the public key as the HMAC secret, allowing an attacker to forge valid signatures.

How do I test for kid injection vulnerabilities?

Modify the kid parameter in the JWT header to attempt path traversal (e.g., ../../../etc/passwd) or inject SQL/command syntax. Check if the server loads an attacker-controlled key or reveals error messages.

What headers should I try for rate-limit bypass?

Start with X-Forwarded-For, X-Real-IP, and Forwarded headers to spoof source IP. Also try User-Agent rotation and path case/slash variants to bypass rate-limit buckets.

How can I exploit GraphQL batch abuse?

Send arrays of mutations (e.g., multiple login or password-reset calls) in a single request, or fetch bulk objects with varying IDs to bypass per-request rate limits.

What mass-assignment fields should I test first?

Try injecting role, isAdmin, admin, verified, plan, tier, permissions, org, and owner fields in API payloads to escalate privileges or modify account attributes.

Full instructions (SKILL.md)

Source of truth, from yaklang/hack-skills.


name: api-auth-and-jwt-abuse description: >- API authentication and JWT abuse playbook. Use when testing bearer tokens, API keys, claim trust, header spoofing, rate limits, and API auth boundary weaknesses.

SKILL: API Auth and JWT Abuse — Token Trust, Header Tricks, and Rate Limits

AI LOAD INSTRUCTION: Use this skill when APIs rely on JWT, bearer tokens, API keys, or weak request identity signals. Focus on token trust boundaries, claim misuse, header spoofing, and rate-limit bypass.

1. TOKEN TRIAGE

Inspect:

  • alg, kid, jku, x5u
  • role, org, tenant, scope, or privilege claims
  • issuer and audience mismatches
  • reuse of mobile and web tokens across products

2. QUICK ATTACK PICKS

PatternFirst Test
alg:none acceptanceunsigned token with trailing dot
RS256 confusionswitch to HS256 using public key as secret
kid lookup trustpath traversal or injection in kid
remote key fetch trustattacker-controlled jku or x5u
weak secretoffline crack with targeted wordlists

3. HIDDEN FIELDS AND BATCH ABUSE

Mass assignment field picks

role
isAdmin
admin
verified
plan
tier
permissions
org
owner

Rate limit and batch abuse picks

X-Forwarded-For: 1.2.3.4
X-Real-IP: 5.6.7.8
Forwarded: for=9.9.9.9

GraphQL or JSON batch abuse candidates:

  • arrays of login mutations
  • bulk object fetches with varying IDs
  • repeated password reset or verification calls in one request

4. RATE LIMIT BYPASS FAMILIES

X-Forwarded-For
X-Real-IP
Forwarded
User-Agent rotation
Path case / slash variants

5. NEXT ROUTING

  • For GraphQL batching and hidden parameters: graphql and hidden parameters
  • For default credential and brute-force planning: authentication bypass
  • For full JWT and OAuth depth: jwt oauth token attacks
  • For OAuth or OIDC configuration flaws in browser and SSO flows: oauth oidc misconfiguration
  • For credentialed browser reads and origin trust bugs: cors cross origin misconfiguration