🇰🇷 한글 설명
PyJWT 라이브러리에서 사용자가 JWT 서명 알고리즘을 임의로 선택할 수 있는 취약점이 발견되었습니다. 개발자가 허용할 알고리즘을 명시적으로 지정하지 않고 모든 알고리즘을 허용하도록 설정할 경우 보안 위협이 발생할 수 있습니다. 이를 해결하기 위해서는 PyJWT 버전을 v2.4.0 이상으로 업그레이드해야 합니다.
💡 쉬운 설명
인증 토큰을 만들 때 사용하는 암호화 방식이 공격자에 의해 조작될 수 있는 문제입니다. 공격자가 가짜 인증서를 진짜처럼 속여서 시스템에 침입할 위험이 있습니다.
🇺🇸 원문 (English)
PyJWT is a Python implementation of RFC 7519. PyJWT supports multiple different JWT signing algorithms. With JWT, an attacker submitting the JWT token can choose the used signing algorithm. The PyJWT library requires that the application chooses what algorithms are supported. The application can specify `jwt.algorithms.get_default_algorithms()` to get support for all algorithms, or specify a single algorithm. The issue is not that big as `algorithms=jwt.algorithms.get_default_algorithms()` has to be used. Users should upgrade to v2.4.0 to receive a patch for this issue. As a workaround, always be explicit with the algorithms that are accepted and expected when decoding.
📍 영향받는 시스템
PyJWT 버전 2.4.0 미만
⚔️ 공격 벡터
공격자가 JWT 토큰의 헤더를 조작하여 허용되지 않은 서명 알고리즘을 사용하여 인증을 우회함
🛡️ 대응 방법
PyJWT 라이브러리를 v2.4.0 이상으로 업데이트하고, decode 함수 사용 시 허용할 알고리즘을 명시적으로 지정함
🔧 검증 코드
출력된 버전 번호가 2.4.0보다 낮은지 확인합니다.
pip show PyJWT | grep Version