🔍 CVE-2021-22112

8.8
CVSS Score
HIGH
2021-02-23
2026-06-17 03:36
✅ 완료

🇰🇷 한글 설명

Spring Security의 특정 버전에서 단일 요청 내에 SecurityContext가 두 번 이상 변경될 경우, 변경된 보안 컨텍스트가 제대로 저장되지 않는 취약점이 존재합니다. 공격자가 직접 이 버그를 유발할 수는 없으나, 애플리케이션 설계 의도와 달리 권한 상승 상태가 요청 전체에 유지되어 권한이 확장될 위험이 있습니다.

💡 쉬운 설명

사용자의 권한을 잠시만 높였다가 다시 낮추려고 할 때, 보안 설정이 제대로 초기화되지 않고 높은 권한이 계속 유지되는 문제입니다. 이로 인해 원래는 접근할 수 없는 기능까지 권한이 남용될 수 있습니다.

🇺🇸 원문 (English)

Spring Security 5.4.x prior to 5.4.4, 5.3.x prior to 5.3.8.RELEASE, 5.2.x prior to 5.2.9.RELEASE, and older unsupported versions can fail to save the SecurityContext if it is changed more than once in a single request.A malicious user cannot cause the bug to happen (it must be programmed in). However, if the application's intent is to only allow the user to run with elevated privileges in a small portion of the application, the bug can be leveraged to extend those privileges to the rest of the application.

📍 영향받는 시스템

Spring Security 5.4.x (< 5.4.4), 5.3.x (< 5.3.8.RELEASE), 5.2.x (< 5.2.9.RELEASE) 및 이전 미지원 버전

⚔️ 공격 벡터

애플리케이션 로직 내에서 권한 변경이 반복될 때 발생하는 논리적 결함을 이용한 권한 상승

🛡️ 대응 방법

Spring Security를 최신 패치 버전(5.4.4, 5.3.8.RELEASE, 5.2.9.RELEASE 이상)으로 업데이트

🔧 검증 코드

출력된 결과에서 spring-security-core의 버전이 취약한 범위(5.4.4 미만, 5.3.8 미만, 5.2.9 미만)에 해당하는지 확인

Shell / Script
mvn dependency:tree | grep -E 'spring-security-core:[0-5]\.[0-9]\.'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Spring Security