Intel

AIKIDO-2026-574328

keras is vulnerable to Unsafe Deserialization

Unsafe DeserializationCVE-2026-12484 Published 6 days ago

78

High Risk

This Affects:

PYTHONkeras
3.11.3 - 3.14.1
Fixed in 3.15.0
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.

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.

Background info

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

How to fix this

Upgrade the keras library to the patch version.