Deserialization of Untrusted Data Affecting py3.12-keras package, versions <3.14.1-r0


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

Social Trends
EPSS
0.47% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-MINIMOSLATEST-PY312KERAS-17924008
  • published10 Jul 2026
  • disclosed3 Jul 2026

Introduced: 3 Jul 2026

CVE-2026-12481  (opens in a new tab)
CWE-502  (opens in a new tab)

How to fix?

Upgrade Minimos:latest py3.12-keras to version 3.14.1-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream py3.12-keras package and not the py3.12-keras package as distributed by Minimos. See How to fix? for Minimos:latest relevant fixed versions and status.

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.