Intel

AIKIDO-2026-574328

keras is vulnerable to Unsafe Deserialization

CVE-2026-12484Published Jul 28, 2026
July 28, 2026

78

CVE Score

High

Unsafe Deserialization

Are you affected? Scan for Free

TL;DR

TorchModuleWrapper.from_config restores a base64-encoded torch.nn.Module with torch.load(..., weights_only=False). Its safe-mode check only blocked when ambient in_safe_mode() was truthy, so a direct from_config call—or any path where the deserialization scope is unset—still unpickled attacker-controlled data and could execute arbitrary code. The fix treats an unset safe mode as safe and refuses the load unless safe_mode is explicitly disabled.

How do I fix this?

Upgrade the keras library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you deserialize TorchModuleWrapper configs or models that contain them from untrusted sources.

Package

Versions

3.11.3 - 3.12.2

Fixed in 3.12.3

3.13.0 - 3.14.1

Fixed in 3.15.0

Background info

keras is vulnerable to Unsafe Deserialization in versions 3.11.3 - 3.12.2 and 3.13.0 - 3.14.1.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea