🇰🇷 한글 설명
Keras 3.14.0 미만 버전의 아카이브 추출 유틸리티에서 경로 순회(Path Traversal) 취약점이 발견되었습니다. 추출 대상 디렉토리 대신 현재 작업 디렉토리(CWD)를 검증 기준으로 사용하여, 루트 디렉토리에서 실행될 경우 보안 우회가 가능하며 임의의 파일 쓰기가 가능합니다.
💡 쉬운 설명
Keras 프로그램이 압축 파일을 풀 때, 잘못된 위치를 기준으로 검사하는 버그가 있습니다. 이로 인해 해커가 의도하지 않은 시스템 폴더에 악성 파일을 덮어쓸 수 있습니다.
🇺🇸 원문 (English)
Keras versions prior to 3.14.0 are vulnerable to a path traversal issue in the archive extraction utilities located in `keras/src/utils/file_utils.py`. The functions `filter_safe_tarinfos()` and `filter_safe_zipinfos()` validate archive member paths against the process current working directory (CWD) instead of the actual extraction destination. When the process runs with CWD set to `/`, which is common in Docker containers, CI/CD runners, and Jupyter environments, the validation boundary becomes the filesystem root, allowing traversal paths to bypass the security check. Additionally, the zip filter contains a bug that causes an `AttributeError` when a blocked entry is encountered, leading to incomplete extraction. Furthermore, Python 3.11 installations lack the `filter="data"` safety net, leaving them entirely reliant on the flawed CWD-based filter. Exploitation of this vulnerability can result in arbitrary file writes outside the intended extraction directory, enabling attackers to overwrite configuration files, inject malicious code, or corrupt machine learning datasets and pipelines.
📍 영향받는 시스템
Keras < 3.14.0
⚔️ 공격 벡터
악성 경로가 포함된 아카이브 파일을 업로드하여 추출 과정에서 임의 파일 덮어쓰기 수행
🛡️ 대응 방법
Keras 패키지를 3.14.0 이상 버전으로 즉시 업그레이드하십시오.
🔧 검증 코드
출력된 버전 번호가 3.14.0보다 낮으면 취약한 버전이므로 업그레이드가 필요합니다.
python -c "import keras; print(keras.__version__)" 2>/dev/null || pip show keras | grep Version