2022년 03월 30일 Java 프레임워크인 Spring에 RCE 취약점이 공개되었다.
Log4Shell 과 비슷 하기 때문에 취약점 Spring4Shell 이라고 명명했습니다 . 실제로는 Log4Shell보다 더 효과적입니다.
(지난 log4shell 악몽이 떠오르는 군요..)
1. 취약점 정보
https://www.cyberkendra.com/2022/03/springshell-rce-0-day-vulnerability.html?m=1 CVE-2022-22963 - spring cloud function에서 발생하는 RCE 취약점
CVE-2022-22965 - spring core에서 발생하는 RCE 취약점(Spring4Shell)
2. 취약 대상
(1) JDK 9 이상
(2) Spring 프레임워크 사용
Spring 5.3.0 ~ 5.3.17, 5.2.0 ~ 5.2.19 및 이전 버전
Spring Cloud Function 3.1.6 ~ 3.2.2 버전
※ 취약점이 해결된 버전 제외(3.1.7, 3.2.3 업데이트 버전 제외)
3. 세부내용
https://www.cyberkendra.com/2022/03/spring4shell-details-and-exploit-code.html?m=1
(1) JDK 버전 확인 : JDK9 버전 이상 영향
(2) Spring 프레임워크 사용 여부 확인
- spring-beans-*.jar 파일이 존재하는지 확인
- CachedIntrospectionResuLts.class 파일 존재하는지 확인
4. 대응방법
(1) JDK 9 미만 버전으로 다운그레이드
(2) WAF 및 패턴기반 네트워크 보안 장비에 룰 추가 - "class.*", "Class.*", "*.class.*", "*.Class.*"와 같은 문자열에 대한 규칙을 설정
(3) 프로젝트 패키지 아래 해당 전역 클래스 생성 후 재컴파일(테스트 필요)
import org.springwork.core.Ordered; import org.springwork.core.annotation.Order; import org.springwork.web.bind.WebDataBinder; import org.springwork.web.bind.annotation.ControllerAdvice; import org.springwork.web.bind.annotation.InitBinder; @ControllerAdvice @Order(10000) public class BinderControllerAdvice { @InitBinder public setAllowedFields(WebDataBinder dataBinder) { String[] denylist = new String[]{"class.*", "Class.*", "*.class.*", "*.Class.*"}; dataBinder.setDisallowedFields(denylist); } } |
(4) 소프트웨어 업데이트
Spring framework 5.3.18, 5.2.20 버전으로 업데이트
Spring Cloud Function 3.1.7, 3.2.3 버전으로 업데이트
5. Poc 코드
https://github.com/dinosn/CVE-2022-22963/blob/main/poc.py
https://github.com/chaosec2021/Spring-cloud-function-SpEL-RCE
https://twitter.com/bytehx343/status/1509034539330732033?s=21&t=qj4_3HCJJZZG3c04D_EEKw
참고
https://www.boho.or.kr/data/secNoticeView.do?bulletin_writing_sequence=66592
KISA 인터넷 보호나라&KrCERT
KISA 인터넷 보호나라&KrCERT
www.boho.or.kr
Spring Java 프레임워크 원격코드실행 취약점(Spring4Shell) 주의!
Spring Core Java 프레임워크에서 원격코드실행이 가능한 제로데이 취약점(Spring4Shell)이 발견되었습니다. Spring 프레임워크의 JDK9버전(및 그 상위버전)중, 특정 조건을 만족하는 상황에서 원격공격자
blog.alyac.co.kr
'https://blog.sonatype.com/new-0-day-spring-framework-vulnerability-confirmed
New Spring Framework RCE Vulnerability Confirmed - What to do?
A new remote code execution flaw dubbed Springshell is affecting Spring-core, exploiting a previously unknown security vulnerability.
blog.sonatype.com
'보안동향' 카테고리의 다른 글
[단독] 삼성이 내놓은 '슈퍼 앱', 나흘 만에 금융정보 유출 (0) | 2022.04.21 |
---|---|
Git 취약점(CVE-2022-24765, CVE-2022-24767) (0) | 2022.04.14 |
Lapsus$ 해킹 그룹 (0) | 2022.03.25 |
악성코드, 훔친 NVIDIA 코드 서명 인증서 사용해 (0) | 2022.03.08 |
TCP Middlebox Reflection for Amplified DDoS Attacks (0) | 2022.03.03 |