Menu

A .nemo checkpoint is a tar file: two risks your model scanner may not open
📰

A .nemo checkpoint is a tar file: two risks your model scanner may not open

DEV Community: python·munimv2·17 days ago
#UJgf7QPL
#devtopython#devto#dev#nemo#pickle
Reading 0:00
15s threshold

NVIDIA NeMo saves models as .nemo files. It is easy to treat one as an opaque blob, but a .nemo is just a tar archive (uncompressed, or gzip/bz2/xz in older releases) that bundles a model_config.yaml with model_weights.ckpt and sometimes a tokenizer or vocabulary. When you call restore_from , NeMo untars the archive and torch.load -s the weights. So the loader treats the tar as transparent, and a scanner that does not open it misses two separate things.

Risk 1: a pickle one container deep

model_weights.ckpt is a torch.save file: a zip holding data.pkl (torch 1.6 and later) or a bare pickle (the legacy format). Either way it is a pickle, and a pickle can carry a __reduce__ gadget that runs on load. Opcode-only pickle scanners and extension routers work on a .pkl or .pt file . They do not untar the .nemo first, so the gadget inside is never disassembled. .nemo is one of the 22 pickle loading paths catalogued in The Art of Hide and Seek (USENIX Security '26, arXiv:2508.19774 ).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.