Downloads · 30 days
13
19% of all-time downloads
xiaoyaoes/keras-compile-config-lambda-rce
keras-compile-config-lambda-rce is a machine learning model from xiaoyaoes. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras. The card lists the license as mit.
ModelScan bypass via compileconfig.loss.lambda
Downloads · 30 days
13
19% of all-time downloads
All-time downloads
67
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 33%
From the Hugging Face model README
ModelScan bypass via compile_config.loss.lambda
Keras v3 models can specify a loss function of type __lambda__. When loaded with safe_mode=False, Keras eval()'s the lambda source string, allowing arbitrary code execution.
ModelScan checks for class_name: "Lambda" (capital L, referring to the Keras Lambda layer) but does not scan class_name: "__lambda__" (referring to the loss function type). This creates a complete bypass.
pip install keras tensorflow
python3 exploit.py
evil_model.keras — Malicious model with lambda loss containing RCE payloadexploit.py — Loader scriptCVSS 9.8. Supply chain attack via HuggingFace/any model repository.