Observatory defense blueprint · ATO.M0005
Safe Weight Serialization & Artifact Malware Inspection
Mandate SafeTensors weight serialization and pre-load bytecode scanning (ModelScan/Fickling) to eliminate arbitrary code execution when loading model checkpoints.
Control blueprint overview
- Control ID
ATO.M0005- Framework
- Observatory defense blueprint
- Stack layers
- Tool/Sandbox Boundary · Pre-Training · Network/IAM
- Techniques addressed
- 0
- OWASP LLM Top 10
- NIST AI RMF
- Reference URI
https://observatory.silvauren.com/catalog/mitigations/ato-m0005/
Control mechanism
Replaces Turing-complete Python `pickle` checkpoint deserialization with SafeTensors (strict JSON header + pure numeric byte offsets) and inspects any unavoidable legacy `.pt`/`.pkl`/`.h5`/SavedModel archives via static opcode analysis (ModelScan, Fickling) inside network-isolated workers before loading into GPU memory.
Implementation steps
- Configure training/serving loaders to enforce `use_safetensors=True` and `weights_only=True` everywhere, failing hard on raw pickle checkpoints.
- Integrate Protect AI ModelScan and Trail of Bits Fickling into artifact-mirror CI gates to block unsafe `__reduce__`, `os`, `subprocess`, or `eval` opcodes.
- Convert any verified legacy checkpoints into SafeTensors inside an ephemeral air-gapped microVM before internal distribution.
- Block `trust_remote_code=True` across Hugging Face pipelines unless pinned to an audited, signed internal commit SHA.
What this control stops
- Arbitrary code execution via trojanized `.pkl`, `.pt`, `.bin`, or Keras `.h5` files downloaded from public hubs (AML.T0011.000, AML.T0018.002).
- Automated MLOps pipeline compromise during model conversion or evaluation jobs (AML.T0119).
- Silent malware execution hidden inside custom pickled tokenizer or optimizer states.
Known bypass conditions & residual risk
- Pure weight-space backdoors or poisoned parameters stored safely inside valid SafeTensors float tensors.
- Malicious Python code inside unpinned `modeling_*.py` files if `trust_remote_code=True` remains enabled.
- Vulnerabilities in underlying container CUDA/C++ tensor parsing libraries.
Latency, usability & false-refusal trade-offs
Latency: Improves model load startup speed via zero-copy `mmap`; 0 ms inference overhead. | False-Refusal Risk: None; legacy research repos shipping `.bin`/`.pt` require a one-time automated quarantine conversion. | Operational Cost: Low; drop-in CI scanners and loader policy checks.