🇰🇷 한글 설명
OAuthLib 4.0.0 이전 버전에서 client_credentials 및 Resource Owner Password Credentials 토큰 발급 핸들러가 request.client는 기밀 클라이언트로 인증하면서 공격자가 제공한 request.client_id를 grant type 및 scope 검증에 그대로 사용할 수 있습니다. 이로 인해 낮은 권한의 인증된 클라이언트가 다른 클라이언트의 신원으로 권한 검증을 수행하게 되어 허가되지 않은 grant나 scope의 토큰이 발급될 수 있습니다. request.client만으로 권한을 판단하는 검증기는 영향을 받지 않을 수 있으며, 이 문제는 4.0.0 버전에서 수정되었습니다.
💡 쉬운 설명
OAuth 인증 라이브러리가 클라이언트의 신원을 잘못 확인해서, 권한이 낮은 앱이 다른 앱인 척하여 더 높은 권한의 토큰을 받을 수 있습니다. 4.0.0 이상으로 업데이트하면 해결됩니다.
🇺🇸 원문 (English)
OAuthLib is an implementation of the OAuth request-signing logic for Python 3.6+. Prior to 4.0.0, the client_credentials and Resource Owner Password Credentials token grant handlers can authenticate request.client as one confidential client while retaining an attacker-supplied request.client_id for validate_grant_type and validate_scopes. A lower-privilege authenticated client can therefore cause grant and scope authorization to use another client's identity when an application validator relies on the documented client_id argument, potentially issuing tokens with unauthorized grants or scopes. Validators that authorize exclusively from request.client may not be affected. This issue is fixed in version 4.0.0.
📍 영향받는 시스템
OAuthLib 4.0.0 미만 Python 버전 (client_credentials 및 Password grant 사용 시)
⚔️ 공격 벡터
인증된 저권한 클라이언트가 요청에 다른 클라이언트의 client_id를 조작해 넣어 grant 및 scope 검증을 우회해 권한 초과 토큰을 발급받음
🛡️ 대응 방법
oauthlib 패키지를 4.0.0 이상으로 업그레이드 (pip install --upgrade 'oauthlib>=4.0.0')
🔧 검증 코드
출력된 Version 값이 4.0.0 미만이면 취약하므로 업그레이드가 필요하고, 4.0.0 이상이면 수정된 버전입니다.
pip show oauthlib 2>/dev/null | grep -i '^version'