CVE-2025-1550CWE-94

Arbitrary Code Execution via Crafted Keras Config for Model Loading

High · published March 11, 2025

CVSS v4.0
7.3
EPSS
3%
Percentile
85.4
In the wild
Unconfirmed
What it is

🚨 A crafty .keras archive can execute arbitrary code, even with safe_mode=True. This means a rogue config.json could make your model load a malicious script instead of what you intended! ⚡ Think of it like a recipe book where someone sneaks in a dangerous ingredient list that changes what you’re actually cooking. You think you're baking a cake, but you end up with a pie full of worms instead! An attacker could hijack your model-loading process, executing any Python code they want. This could lead to data breaches, system compromise, or worse – they could exploit your environment and gain control over critical resources! Absolutely devastating!

Put simply

Think of it like a recipe book where someone sneaks in a dangerous ingredient list that changes what you’re actually cooking. You think you're baking a cake, but you end up with a pie full of worms instead! The Keras Model.load_model function allows attackers to manipulate the config.json file in a malicious .keras archive. This lets them specify arbitrary Python modules and functions to load, creating a pathway for remote code execution during model loading.

What to do

An attacker could hijack your model-loading process, executing any Python code they want. This could lead to data breaches, system compromise, or worse – they could exploit your environment and gain control over critical resources! Absolutely devastating! To safeguard against this vulnerability, update Keras to the latest version that addresses this flaw. Be cautious with any .keras archives you load, especially if they come from untrusted sources. Regularly audit your model-loading practices to ensure safety! You've got this! With these steps, you'll be one step closer to locking down your models and protecting your environment. 🛡️

The record
Technical detail
CVSS v4.0
7.3 · HIGH
Vector
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
EPSS
0.02626 · 85.4th percentile
Weakness
CWE-94 · Improper Control of Generation of Code ('Code Injection')
Published
2025-03-11T08:12Z
EPSS history
Timeline
  • 11 MAR 08:12Z
    Arbitrary Code Execution via Crafted Keras Config for Model Loading
    cvelistv5