Keras: TorchModuleWrapper can deserialize unsafe PyTorch pickle data
High severity
GitHub Reviewed
Published
Jul 19, 2026
to the GitHub Advisory Database
•
Updated Aug 7, 2026
Description
Published by the National Vulnerability Database
Jul 19, 2026
Published to the GitHub Advisory Database
Jul 19, 2026
Reviewed
Aug 7, 2026
Last updated
Aug 7, 2026
A vulnerability in keras-team/keras version 3.15.0 allows unsafe deserialization of attacker-controlled PyTorch pickle data through the public
keras.layers.TorchModuleWrapper.from_configmethod. This method invokestorch.load(..., weights_only=False)without requiring an explicit unsafe opt-in, such as asafe_mode=Falseparameter. When called outside aSafeModeScope(True)context, the absence of an ambient safe mode state permits unsafe deserialization by default. This issue can lead to arbitrary code execution if untrusted Keras layer configurations are processed using this method. The vulnerability arises because the method does not enforce safe deserialization practices unless explicitly guarded by Keras safe mode.References