🔍 CVE-2025-9905

7.3
CVSS Score
HIGH
2025-09-19
2026-10-19 16:10
✅ 완료

🇰🇷 한글 설명

Keras의 Model.load_model 메서드에서 safe_mode=True 설정이 활성화되어 있어도 임의 코드가 실행될 수 있는 취약점입니다. 공격자가 특수하게 제작된 .h5/.hdf5 모델 파일을 통해 Lambda 레이어의 피클링 기능을 악용하여 시스템 권한을 탈취할 수 있습니다.

💡 쉬운 설명

악성 코드가 숨겨진 인공지능 모델 파일을 불러오기만 해도 컴퓨터가 해킹될 수 있는 문제입니다. 보안 모드를 켜두어도 구형 파일 형식(.h5)을 사용할 때는 이 보호 기능이 작동하지 않는 것이 원인입니다.

🇺🇸 원문 (English)

The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. One can create a specially crafted .h5/.hdf5 model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed. This is achieved by crafting a special .h5 archive file that uses the Lambda layer feature of keras which allows arbitrary Python code in the form of pickled code. The vulnerability comes from the fact that the safe_mode=True option is not honored when reading .h5 archives. Note that the .h5/.hdf5 format is a legacy format supported by Keras 3 for backwards compatibility.

📍 영향받는 시스템

Keras 3 (legacy .h5/.hdf5 format 사용 시)

⚔️ 공격 벡터

악성 Lambda 레이어가 포함된 .h5 또는 .hdf5 모델 파일을 Model.load_model로 로드

🛡️ 대응 방법

모델 파일을 .keras 형식으로 전환하여 사용하거나, 신뢰할 수 없는 출처의 .h5 파일 로드를 금지함

🔧 검증 코드

설치된 Keras 버전을 확인하여 취약한 버전 환경인지 파악함

Shell / Script
pip show keras | grep -E 'Version'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Python