🇰🇷 한글 설명
PyJWT 2.9.0부터 2.12.1 버전에서 jwt.decode() 사용 시 토큰 헤더의 알고리즘은 허용 목록과 비교하지만 실제 서명 검증은 PyJWK 객체에 바인딩된 알고리즘으로 수행되는 알고리즘 검증 우회 취약점이 존재합니다. 등록된 JWK/JWKS 개인키를 보유한 공격자는 허용되지 않은 알고리즘으로 서명하면서 헤더에는 허용된 알고리즘을 명시하여 토큰 검증을 우회할 수 있습니다.
💡 쉬운 설명
PyJWT의 JWT 토큰 검증이 헤더의 알고리즘 이름만 확인하고 실제 서명은 다른 알고리즘으로 검증하는 결함이 있습니다. 공격자가 이를 악용하여 허용되지 않은 알고리즘으로 위조된 토큰을 승인받을 수 있습니다.
🇺🇸 원문 (English)
PyJWT is a JSON Web Token implementation in Python. From 2.9.0 to 2.12.1, there is a verifier-side algorithm allow-list bypass when jwt.decode() or jwt.decode_complete() are called with a PyJWK key. The token header alg is checked against the caller-supplied algorithms allow-list, but signature verification is performed with the algorithm bound to the PyJWK object instead of the header algorithm. An attacker who controls a registered JWK/JWKS private key can sign with a disallowed algorithm, advertise an allowed algorithm in the JWT header, and still be accepted. The issue affects the documented PyJWKClient.get_signing_key_from_jwt(...) flow. This vulnerability is fixed in 2.13.0.
📍 영향받는 시스템
PyJWT 2.9.0 ~ 2.12.1 (Python 라이브러리)
⚔️ 공격 벡터
공격자가 등록된 JWK 개인키로 비허가 알고리즘(RS256 등)으로 서명하되 헤더에는 허가된 알고리즘으로 표기하여 제출
🛡️ 대응 방법
PyJWT를 2.13.0 이상으로 즉시 업그레이드
🔧 검증 코드
2.13.0 이상이면 안전, 2.12.1 이하면 즉시 업그레이드 필요
pip show PyJWT | grep Version | awk '{print $2}'