🇰🇷 한글 설명
Python의 platform-independent 파일 잠금 라이브러리인 filelock 4.2.1 미만 버전에서 발생하는 취약점입니다. 로컬 사용자가 권한을 가진 경우, UnixFileLock이 잠금 경로로 이름이 변경된 일반 파일을 잘라내거나(truncate) 특정 모드 요청 시 파일의 모드를 변경할 수 있습니다.
💡 쉬운 설명
파일을 안전하게 잠그는 기능이 설계 결함으로 인해, 다른 사용자가 악의적으로 파일을 바꿔치기하면 파일 내용이 지워지거나 권한이 변경될 수 있는 문제입니다. 이로 인해 데이터 손실이나 보안 설정 변경이 발생할 수 있습니다.
🇺🇸 원문 (English)
filelock is a platform-independent file lock for Python. Prior to 4.2.1, UnixFileLock can truncate a regular file renamed onto the lock path when another local user has actual rename permission, or hard-linked there under a permissive hard-link policy; when an explicit mode is requested, affected versions from 3.10.2 can also change that file's mode. This issue is fixed in version 4.2.1.
📍 영향받는 시스템
filelock library versions prior to 4.2.1 (specifically 3.10.2 and below for mode change issue)
⚔️ 공격 벡터
로컬 권한을 가진 사용자가 잠금 파일 경로에 파일을 이름 변경(rename)하거나 하드 링크(hard-link)를 생성하여 공격
🛡️ 대응 방법
filelock 라이브러리를 4.2.1 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 Version 값이 4.2.1 미만이면 취약한 상태이며, 4.2.1 이상이면 안전합니다.
pip show filelock | grep Version