🔍 CVE-2025-12638

8.0
CVSS Score
HIGH
2025-11-28
2026-10-19 13:10
✅ 완료

🇰🇷 한글 설명

Keras 3.11.3에서 tar 파일 추출 시 filter='data' 보안 매개변수를 적용하지 않아 발생하는 경로 조회 취약점입니다. 심볼릭 링크 해석 버그로 인해 PATH_MAX 제한을 우회하여 의도된 추출 디렉토리 밖에 파일을 작성할 수 있으며, 이를 통해 시스템 손상이나 악성 코드 실행이 가능합니다.

💡 쉬운 설명

Keras 라이브러리의 파일 다운로드 기능에서 압축 파일을 풀 때 보안 검사를 제대로 하지 않는 문제입니다. 공격자가 특수하게 조작된 압축 파일을 제공하면 컴퓨터의 다른 위치에 악성 파일을 설치할 수 있습니다.

🇺🇸 원문 (English)

Keras version 3.11.3 is affected by a path traversal vulnerability in the keras.utils.get_file() function when extracting tar archives. The vulnerability arises because the function uses Python's tarfile.extractall() method without the security-critical filter='data' parameter. Although Keras attempts to filter unsafe paths using filter_safe_paths(), this filtering occurs before extraction, and a PATH_MAX symlink resolution bug triggers during extraction. This bug causes symlink resolution to fail due to path length limits, resulting in a security bypass that allows files to be written outside the intended extraction directory. This can lead to arbitrary file writes outside the cache directory, enabling potential system compromise or malicious code execution. The vulnerability affects Keras installations that process tar archives with get_file() and does not affect versions where this extraction method is secured with the appropriate filter parameter.

📍 영향받는 시스템

Keras 3.11.3 이하 버전에서 tar 파일을 추출하는 모든 시스템

⚔️ 공격 벡터

악의적으로 조작된 tar 아카이브를 keras.utils.get_file() 함수로 처리하게 하여 경로 조회 공격 실행

🛡️ 대응 방법

Keras를 최신 보안 패치 버전으로 업그레이드하거나 tarfile.extractall()에 filter='data' 매개변수를 추가한 버전으로 업데이트

🔧 검증 코드

설치된 Keras 버전이 출력되며, 3.11.3 이하이면 취약 버전이므로 즉시 업그레이드가 필요합니다.

Shell / Script
pip show keras | grep Version | awk '{print $2}'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Python