🔍 CVE-2025-12058

0.0
CVSS Score
UNKNOWN
2025-10-29
2026-10-19 13:10
✅ 완료

🇰🇷 한글 설명

Keras의 Keras.Model.load_model 메서드는 safe_mode=True 설정이 활성화된 상태에서도 임의의 로컬 파일 읽기 및 SSRF(Server-Side Request Forgery) 공격에 취약합니다. 이는 StringLookup 레이어가 모델 로드 시 악의적으로 조작된 .keras 아카이브 내의 로컬 또는 원격 경로를 처리하는 방식에서 발생합니다.

💡 쉬운 설명

해커가 만든 특수한 인공지능 모델 파일을 불러오기만 해도, 서버에 있는 중요한 파일을 몰래 읽거나 서버를 이용해 외부 네트워크에 공격을 시도할 수 있습니다. 보안 모드를 켜두어도 이 취약점은 막을 수 없다는 것이 문제입니다.

🇺🇸 원문 (English)

The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF). This vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path. * Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system. * Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition. The security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.

📍 영향받는 시스템

Keras 라이브러리 (StringLookup 레이어를 사용하는 모델 로드 기능 포함)

⚔️ 공격 벡터

악의적으로 조작된 .keras 파일을 생성하여 load_model 메서드로 로드함

🛡️ 대응 방법

Keras 라이브러리를 최신 보안 패치가 적용된 버전으로 업데이트하십시오.

🔧 검증 코드

출력된 Keras 버전을 확인하여 해당 취약점이 해결된 최신 버전인지 확인합니다.

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

💻 영향받는 소프트웨어

Spring Data REST