🔍 CVE-2024-4030

7.1
CVSS Score
HIGH
2024-05-07
2026-04-15 00:35
✅ 완료

🇰🇷 한글 설명

Windows에서 tempfile.mkdtemp()가 생성하는 임시 디렉토리의 권한이 제대로 설정되지 않아, 다른 사용자도 디렉토리에 접근할 수 있는 취약점입니다. Python이 Windows에서 Unix 권한을 지원하지 않아 발생한 문제로, mkdir 함수에 Unix "700" 권한 지원을 추가하여 수정되었습니다.

💡 쉬운 설명

Windows에서 임시 폴더를 만들 때 다른 사용자도 접근할 수 있는 보안 문제입니다. Python을 최신 버전으로 업데이트하면 해결됩니다.

🇺🇸 원문 (English)

On Windows a directory returned by tempfile.mkdtemp() would not always have permissions set to restrict reading and writing to the temporary directory by other users, instead usually inheriting the correct permissions from the default location. Alternate configurations or users without a profile directory may not have the intended permissions. If you’re not using Windows or haven’t changed the temporary directory location then you aren’t affected by this vulnerability. On other platforms the returned directory is consistently readable and writable only by the current user. This issue was caused by Python not supporting Unix permissions on Windows. The fix adds support for Unix “700” for the mkdir function on Windows which is used by mkdtemp() to ensure the newly created directory has the proper permissions.

📍 영향받는 시스템

Windows에서 Python을 사용하는 모든 버전 (정확한 버전은 Python 배포 공지 참조)

⚔️ 공격 벡터

로컬 공격자가 tempfile.mkdtemp()로 생성된 임시 디렉토리에 접근하여 민감한 정보 유출 또는 파일 변조 수행

🛡️ 대응 방법

Python을 최신 보안 패치가 적용된 버전으로 업데이트 (또는 Unix/Linux 사용으로 영향 회피)

🔧 검증 코드

명령어 실행 결과가 'PATCHED'이면 안전하고, 'VULNERABLE'이면 Python을 업데이트해야 합니다.

Shell / Script
python -c "import tempfile,os,stat;d=tempfile.mkdtemp();m=oct(os.stat(d).st_mode);print('VULNERABLE' if '700' not in m else 'PATCHED')"

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

💻 영향받는 소프트웨어

Python