Instructions to use missamehdi/model-keras-lambda-rce with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use missamehdi/model-keras-lambda-rce with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://missamehdi/model-keras-lambda-rce") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
PoC: Keras Lambda Layer ACE
Vulnerability
Arbitrary Code Execution via Keras Lambda Layer Deserialization
Format
Keras Native (.keras)
Impact
- Full system compromise when model loaded with safe_mode=False
- Arbitrary code execution
- Bounty: $3,000-$4,000
Test
keras.config.enable_unsafe_deserialization()
model = keras.models.load_model('malicious_keras_ace.keras') # RCE!
- Downloads last month
- 1
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://missamehdi/model-keras-lambda-rce")