YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)
Keras safe_mode Function Injection Bypass — PoC
Vulnerability: safe_mode=True in keras.saving.load_model() only blocks 7 specific API names. 739/744 registered Keras functions bypass this check and can be injected into model configs.
Impact: SSRF, state corruption, DoS via crafted .keras model files.
Files:
poc.py— Full proof-of-concept with all attack variantsssrf_mnist_load_data.keras— .keras model withkeras.datasets.mnist.load_dataas activation (SSRF)state_corruption_set_floatx.keras— .keras model withkeras.config.set_floatxas activationdos_clear_session.keras— .keras model withkeras.utils.clear_sessionas activation
Reproduction:
pip install keras tensorflow numpy
python poc.py
CWE: CWE-502 (Deserialization of Untrusted Data) Affected: Keras 3.x (tested 3.13.2)
- Downloads last month
- 7