Instructions to use xiaoyaoes/modelscan-regularizer-constraint-bypass with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use xiaoyaoes/modelscan-regularizer-constraint-bypass 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://xiaoyaoes/modelscan-regularizer-constraint-bypass") - Notebooks
- Google Colab
- Kaggle
ModelScan Regularizer & Constraint from_config Bypass
What This Is
ModelScan only checks Lambda layers. Regularizers and constraints embedded inside layer configs (kernel_regularizer, bias_regularizer, kernel_constraint, bias_constraint) are completely ignored.
This .keras file uses both a custom regularizer and a custom constraint, each with malicious from_config(). ModelScan reports 0 Issues. Loading triggers both payloads.
Verify
python3 poc.py
Attack Surface
Layer config sub-fields not scanned by ModelScan:
kernel_regularizer/bias_regularizer/activity_regularizerkernel_constraint/bias_constraintkernel_initializer/bias_initializer(separate bypass)
Disclosure
Submitted to ProtectAI via huntr.dev.
- Downloads last month
- 7
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support