Critical · published October 17, 2025
🚨 A maliciously crafted Keras file could run arbitrary code on your system, even with safe mode enabled! 🔥 Think of it like a delivery service that accepts packages without checking the contents — you never know when a dangerous parcel might arrive and cause chaos once opened! This vulnerability allows an attacker to execute any code they want on the end user's system, potentially leading to full system compromise. As this could happen through both local and remote files, your system's security is at risk every time a Keras model is loaded!
Think of it like a delivery service that accepts packages without checking the contents — you never know when a dangerous parcel might arrive and cause chaos once opened! The vulnerability arises from the deserialization of untrusted data in versions of the Keras framework from 3.11.0 to below 3.11.3. When a TorchModuleWrapper class is included in a maliciously uploaded Keras file, it can execute arbitrary code when that file is loaded.
This vulnerability allows an attacker to execute any code they want on the end user's system, potentially leading to full system compromise. As this could happen through both local and remote files, your system's security is at risk every time a Keras model is loaded! Upgrade your Keras framework to version 3.11.3 or later immediately. Additionally, review your code to ensure that any uploaded Keras files are properly validated before being processed. Implement strict controls around file uploads to mitigate this risk. You've got this! Follow these steps and you'll bolster your security in no time! 🛡️