🔍 CVE-2021-32701

7.5
CVSS Score
HIGH
2021-06-22
2026-06-17 03:53
✅ 완료

🇰🇷 한글 설명

ORY Oathkeeper의 oauth2_introspection 인증 과정에서 캐시 메커니즘의 결함으로 인해 권한 검증 오류가 발생합니다. 특정 스코프를 가진 토큰이 캐싱되면, 이후 다른 스코프를 요구하는 요청에 대해서도 토큰의 유효성만 확인하고 스코프 일치 여부를 무시하여 잘못된 인증을 허용할 수 있습니다.

💡 쉬운 설명

한 번 인증된 사용자가 원래는 접근할 수 없는 다른 권한 영역까지 캐시된 정보를 이용해 몰래 들어갈 수 있는 보안 허점입니다. 인증 정보가 저장될 때 권한 종류를 제대로 확인하지 않아 발생하는 문제입니다.

🇺🇸 원문 (English)

ORY Oathkeeper is an Identity & Access Proxy (IAP) and Access Control Decision API that authorizes HTTP requests based on sets of Access Rules. When you make a request to an endpoint that requires the scope `foo` using an access token granted with that `foo` scope, introspection will be valid and that token will be cached. The problem comes when a second requests to an endpoint that requires the scope `bar` is made before the cache has expired. Whether the token is granted or not to the `bar` scope, introspection will be valid. A patch will be released with `v0.38.12-beta.1`. Per default, caching is disabled for the `oauth2_introspection` authenticator. When caching is disabled, this vulnerability does not exist. The cache is checked in [`func (a *AuthenticatorOAuth2Introspection) Authenticate(...)`](https://github.com/ory/oathkeeper/blob/6a31df1c3779425e05db1c2a381166b087cb29a4/pipeline/authn/authenticator_oauth2_introspection.go#L152). From [`tokenFromCache()`](https://github.com/ory/oathkeeper/blob/6a31df1c3779425e05db1c2a381166b087cb29a4/pipeline/authn/authenticator_oauth2_introspection.go#L97) it seems that it only validates the token expiration date, but ignores whether the token has or not the proper scopes. The vulnerability was introduced in PR #424. During review, we failed to require appropriate test coverage by the submitter which is the primary reason that the vulnerability passed the review process.

📍 영향받는 시스템

ORY Oathkeeper (oauth2_introspection 캐싱 기능이 활성화된 버전)

⚔️ 공격 벡터

권한이 있는 토큰으로 먼저 요청을 보내 캐시를 생성한 후, 해당 토큰이 권한이 없는 다른 스코프의 엔드포인트에 접근을 시도함

🛡️ 대응 방법

ORY Oathkeeper를 v0.38.12-beta.1 이상의 버전으로 업데이트하거나, oauth2_introspection의 캐싱 기능을 비활성화합니다.

🔧 검증 코드

출력된 버전이 취약점이 해결된 v0.38.12-beta.1 이상인지 확인합니다.

Shell / Script
ory version 2>/dev/null | grep -E 'v0\.38\.12-beta\.1|v0\.38\.12|v0\.39\.'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N