🇰🇷 한글 설명
keras-team/keras 3.14.0 버전의 Lambda 레이어에서 역직렬화 처리 오류로 인해 임의 코드가 실행될 수 있는 취약점이 발견되었습니다. _raise_for_lambda_deserialization() 함수가 safe_mode가 None인 경우 보안 가드를 제대로 적용하지 못해, 공격자가 제어하는 marshal 바이트코드가 실행될 수 있습니다. 이로 인해 서버나 사용자 프로세스 권한으로 OS 수준의 명령이 실행될 수 있습니다.
💡 쉬운 설명
Keras 라이브러리의 특정 기능을 사용할 때 보안 검사가 제대로 작동하지 않아, 해커가 만든 악성 코드가 컴퓨터에서 자동으로 실행될 수 있는 문제입니다. 이를 통해 해커가 사용자의 컴퓨터를 마음대로 조종할 위험이 있습니다.
🇺🇸 원문 (English)
A vulnerability in keras-team/keras version 3.14.0 allows for arbitrary code execution due to improper handling of deserialization in the `Lambda` layer. Specifically, the `_raise_for_lambda_deserialization()` function fails to enforce the safe-mode guard when `safe_mode` is set to `None`, which is the default value when `from_config()` is called outside of a `SafeModeScope` context. This logic error conflates `None` (unset/default-deny) with `False` (explicitly disabled), bypassing the guard and allowing attacker-controlled `marshal` bytecode to be deserialized. Affected call sites include `keras.layers.deserialize(config)`, `keras.models.clone_model(model)`, and any direct invocation of `Lambda.from_config(config)` without an enclosing `SafeModeScope(True)`. This vulnerability can be exploited to achieve arbitrary OS-level code execution in the context of the server or user process.
📍 영향받는 시스템
keras-team/keras version 3.14.0
⚔️ 공격 벡터
조작된 설정값(config)을 포함한 모델을 역직렬화(deserialize)하거나 복제(clone_model)하는 과정을 통해 악성 바이트코드 주입
🛡️ 대응 방법
Keras 버전을 최신 보안 패치가 적용된 버전으로 업데이트하거나, Lambda 레이어 사용 시 반드시 SafeModeScope(True) 컨텍스트 내에서 실행하도록 코드를 수정하십시오.
🔧 검증 코드
출력된 Version 값이 3.14.0인 경우 해당 취약점에 노출된 상태입니다.
pip show keras | grep -E 'Version'