🇰🇷 한글 설명
Spring Framework의 WebMvc.fn과 WebFlux.fn에서 경로 순회(Path Traversal) 취약점으로, RouterFunctions를 통해 정적 리소스를 제공하고 FileSystemResource로 위치가 명시적으로 구성된 경우 발생합니다. 공격자가 악의적인 HTTP 요청으로 프로세스가 접근 가능한 파일시스템의 임의 파일에 접근할 수 있습니다.
💡 쉬운 설명
웹 애플리케이션이 파일을 제공할 때 상위 디렉토리로 접근하는 악의적인 경로를 사용하면 시스템의 중요한 파일을 읽을 수 있는 보안 문제입니다. Spring Security 방화벽을 사용하거나 Tomcat/Jetty 서버에서 실행하면 자동으로 차단됩니다.
🇺🇸 원문 (English)
Applications serving static resources through the functional web frameworks WebMvc.fn or WebFlux.fn are vulnerable to path traversal attacks. An attacker can craft malicious HTTP requests and obtain any file on the file system that is also accessible to the process in which the Spring application is running.
Specifically, an application is vulnerable when both of the following are true:
* the web application uses RouterFunctions to serve static resources
* resource handling is explicitly configured with a FileSystemResource location
However, malicious requests are blocked and rejected when any of the following is true:
* the Spring Security HTTP Firewall https://docs.spring.io/spring-security/reference/servlet/exploits/firewall.html is in use
* the application runs on Tomcat or Jetty
📍 영향받는 시스템
Spring Framework WebMvc.fn, WebFlux.fn을 사용하는 Java 애플리케이션
⚔️ 공격 벡터
HTTP 요청에 ../ 같은 경로 순회 패턴을 포함하여 설정된 디렉토리 상위의 파일 접근 시도
🛡️ 대응 방법
Spring Security HTTP Firewall 활성화, Tomcat/Jetty 서버 사용, 또는 정적 리소스 접근 경로를 명시적으로 제한
🔧 검증 코드
Spring Framework JAR 파일의 버전을 확인하여 취약한 버전으로 업그레이드 필요 여부 판단
find / -name 'spring-*.jar' 2>/dev/null | xargs -I {} sh -c 'unzip -p {} META-INF/MANIFEST.MF 2>/dev/null | grep -i version' | head -1