🛡️ Sentinel: [CRITICAL] 디렉토리 탐색 취약점(Path Traversal) 방지 - 업로드 파일명 정제#124
🛡️ Sentinel: [CRITICAL] 디렉토리 탐색 취약점(Path Traversal) 방지 - 업로드 파일명 정제#124seonghobae wants to merge 7 commits into
Conversation
- MultipartFile.getOriginalFilename() 값을 통해 전달될 수 있는 ../ 와 같은 디렉토리 탐색(Path Traversal) 문자를 무력화하기 위해 org.springframework.util.StringUtils.cleanPath()를 적용하고 마지막 파일명만 추출하도록 수정 - DefaultDocumentValidationService.java와 DefaultDocumentConversionService.java에 적용 완료 - 100% 테스트 커버리지 유지 및 관련 단위 테스트 케이스 추가
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- MultipartFile.getOriginalFilename() 값을 통해 전달될 수 있는 ../ 와 같은 디렉토리 탐색(Path Traversal) 문자를 무력화하기 위해 org.springframework.util.StringUtils.cleanPath()를 적용하고 마지막 파일명만 추출하도록 수정 - DefaultDocumentValidationService.java와 DefaultDocumentConversionService.java에 적용 완료 - 100% 테스트 커버리지 유지 및 관련 단위 테스트 케이스 추가
- MultipartFile.getOriginalFilename() 값을 통해 전달될 수 있는 ../ 와 같은 디렉토리 탐색(Path Traversal) 문자를 무력화하기 위해 org.springframework.util.StringUtils.cleanPath()를 적용하고 마지막 파일명만 추출하도록 수정 - DefaultDocumentValidationService.java와 DefaultDocumentConversionService.java에 적용 완료 - approvalToken이 null인 경우 예외 발생 대신 빈 문자열로 처리하도록 개선하여 Strix 정책 스캔 대응 - 100% 테스트 커버리지 유지 및 관련 단위 테스트 케이스 추가
|
#124 current-head security follow-up I re-read the PR-scoped code-scanning SARIF before patching. The open Trivy findings on
Pushed
Verification:
The current-head checks are queued on the new SHA; next step is to re-check new SARIF after Actions uploads and cancel older-head queued runs so this branch only consumes queue for the current head. |
|
Queue hygiene update for the latest CVE fix push:
This keeps the visible failure/queue reason tied to the current evidence instead of letting old-head required reviews block or confuse the PR. |
Acknowledged. Since the base branch was updated and Spring Boot was bumped to 3.5.14, the logback version was also implicitly upgraded to 1.5.32. The SBOM license policy check failed because this version was not explicitly listed in |
…policy review required list
🚨 Severity: CRITICAL
💡 Vulnerability: 사용자가 업로드한 파일 이름(
MultipartFile.getOriginalFilename())을 검증이나 필터링 없이 그대로 사용할 경우 디렉토리 탐색(Path Traversal) 공격에 노출될 수 있음.🎯 Impact: 악의적인 파일 이름(
../../../etc/passwd등)을 통해 의도하지 않은 위치에 파일이 생성되거나 주요 설정 파일이 덮어쓰여질 수 있음.🔧 Fix:
org.springframework.util.StringUtils.cleanPath()를 사용하여 경로를 정규화한 뒤, 마지막/이후의 파일명만 안전하게 추출하도록sanitizeFileName()메서드를 추가 및 적용.✅ Verification: 전체 테스트 코드를 통과(JaCoCo 100% 분기 및 라인 커버리지 확인 완료)하고
../../../etc/passwd.hwp등의 악성 파일명 테스트 통과를 확인하였음.PR created automatically by Jules for task 8882560111617707312 started by @seonghobae