🇰🇷 한글 설명
RansomLook의 GroupPost.get API 핸들러에서 그룹 게시물과 관련된 screen 필드를 처리할 때 경로 탐색(Path Traversal) 취약점이 발생합니다. 공격자가 조작된 경로를 포함한 데이터를 가져오면, 시스템은 검증 없이 해당 경로의 파일을 읽어 Base64로 인코딩하여 응답함으로써 민감한 설정 파일이나 자격 증명을 노출할 수 있습니다.
💡 쉬운 설명
게시물의 이미지 경로를 조작하여 서버 내부의 중요한 비밀 파일들을 몰래 읽어낼 수 있는 보안 약점입니다. 공격자는 이를 통해 비밀번호나 설정 파일 같은 민감한 정보를 탈취할 수 있습니다.
🇺🇸 원문 (English)
RansomLook contains a path traversal vulnerability in the handling of the screen field associated with group posts. The GroupPost.get API handler concatenates the database-controlled screen value directly with the application's source/ directory and opens the resulting path without verifying that the resolved file remains within the intended directory.
Because the screen field is free-form and can be populated either through the administrative post editor or through data imported from a remote RansomLook instance, a malicious upstream instance can provide traversal sequences such as ../config/generic.json. When the affected post is subsequently retrieved through the API, RansomLook resolves and reads the attacker-controlled path and returns the contents of the referenced file Base64-encoded in the API response.
This can allow an attacker (being admin) controlling imported post data to read arbitrary files accessible to the RansomLook process, potentially exposing sensitive configuration data, API credentials, password hashes, or other application secrets. The attack does not require the malicious upstream to possess an account on the affected RansomLook instance.
The vulnerability is addressed by resolving screen paths with os.path.realpath() and verifying that the resolved path remains beneath the application's source/ directory. Validation is performed both when values are written and immediately before files are read. Using canonical paths also prevents traversal through symbolic links that would bypass purely lexical path normalization checks.
📍 영향받는 시스템
RansomLook (GroupPost.get API를 사용하는 버전)
⚔️ 공격 벡터
외부에서 가져온 게시물 데이터의 screen 필드에 ../와 같은 경로 탐색 문자를 삽입하여 API 호출
🛡️ 대응 방법
os.path.realpath()를 사용하여 경로를 정규화하고, 파일 접근 전 해당 경로가 허용된 디렉토리 내에 있는지 검증하는 로직 적용
🔧 검증 코드
소스 코드 내 GroupPost.get 핸들러에서 screen 필드에 대한 경로 검증 로직(os.path.realpath 등)이 누락되었는지 확인합니다.
grep -r "GroupPost.get" /path/to/ransomlook/source/ | grep "screen"
💻 영향받는 소프트웨어
IBM Security Verify Access