offensive-jwt

Tests JWT implementations for algorithm confusion, weak secrets, and header injection vulnerabilities.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/karenrebecag/spec-driven-standards --skill offensive-jwt-karenrebecag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: offensive-jwt
Source: https://github.com/karenrebecag/spec-driven-standards/tree/main/plugins/security/skills/offensive-jwt
Command: npx skills add https://github.com/karenrebecag/spec-driven-standards --skill offensive-jwt-karenrebecag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Penetration testers need a systematic methodology to evaluate JWT-based authentication, and missing a single misconfiguration like alg:none acceptance or RS256-to-HS256 confusion can leave an application exposed to full authentication bypass. ## Core Features & Use Cases - Algorithm Attack Checklist: Covers alg:none bypass, RS256-to-HS256 confusion, and weak HMAC secret brute forcing with jwt_tool and hashcat. - Header Injection Testing: Provides concrete payloads for kid SQL injection and path traversal, jku/x5u remote JWKS injection, inline jwk injection, and JWKS cache poisoning. - Mobile and Advanced Vectors: Includes JWT extraction from Android SharedPreferences and iOS Keychain, timing attacks on HMAC comparison, and SAML/API-key/OAuth token confusion tests. - Use Case: During a web application engagement, you intercept a Bearer token, decode it, discover a kid parameter, and follow the manual testing steps to attempt path traversal via kid pointing to /dev/null, then re-sign the token with an empty secret. ## Quick Start Ask the assistant to walk through the JWT attack checklist against a captured Bearer token from the target application, starting with decoding and the alg:none test.

Frequently Asked Questions about offensive-jwt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a JWT for algorithm confusion attacks?

Change the alg header from RS256 to HS256 and re-sign the token using the server's RSA public key as the HMAC secret. If the server uses the same key variable for both algorithms, it verifies the forged signature and accepts the token.

What tools brute force weak JWT HMAC secrets?

jwt_tool with the -C flag and a wordlist cracks HMAC secrets, and c-jwt-cracker offers a faster C implementation. hashcat also supports JWT cracking mode for HS256, HS384, and HS512 signatures.

How do I exploit the kid parameter in a JWT header?

Inject path traversal values like ../../../../dev/null to force the server to verify against an empty known file, or inject SQL syntax like ' OR 1=1 -- if kid feeds a database query. Both work only when the server fails to sanitize kid lookups.

Can JWTs be extracted from mobile apps for testing?

Yes. On Android, check SharedPreferences files or use adb backup when allowBackup is true; on iOS, extract from Keychain via jailbreak tools or unencrypted backups. Frida, objection, and MobSF automate runtime extraction on both platforms.

Why does the alg:none JWT attack fail on some servers?

Modern libraries reject unsigned tokens by default and require explicit opt-in for the none algorithm. Failure indicates the server properly disables none, so move on to case variants like None or NONE, then test algorithm confusion instead.

When should I use PASETO instead of JWT?

PASETO removes algorithm negotiation entirely, eliminating confusion and downgrade attacks by design. Choose it for new systems where you control both token issuer and consumer and do not need JWT ecosystem compatibility.