Downloads · 30 days
0
Spoko-dev/huntr-mfv-torch-package-scanner-evasion
huntr-mfv-torch-package-scanner-evasion is a machine learning model from Spoko-dev. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a security-research proof-of-concept for a huntr Model File Vulnerabilities (MFV) submission. It is not malware — the payload only writes a harmless marker to /tmp (echo/id). Do not modify to run real commands.
Downloads · 30 days
0
Access
Public
Updated Jul 10, 2026
Repo size
2.6 KB
Likes
0
Public
Click a slice to open those files.
.md3.5 KB · 35%
From the Hugging Face model README
This is a security-research proof-of-concept for a huntr Model File Vulnerabilities (MFV) submission. It is not malware — the payload only writes a harmless marker to /tmp (echo/id). Do not modify to run real commands.
Loading malicious_pkgmod.pt with the default torch.package.PackageImporter(...).load_pickle() API executes code, while modelscan and picklescan scan the file and report no issues — a model-scanner false-negative. The malicious logic lives in packaged module source (benignmod.py), executed via find_class → import_module → compile(..., "exec"); the embedded pickle carries no dangerous opcodes (GLOBAL benignmod.Widget + STOP).
pip install torch==2.13.0 modelscan==0.8.8 picklescan==1.0.4 # Python 3.10+
# scanners report CLEAN even though they scan the embedded pickle
modelscan -p malicious_pkgmod.pt # -> "No issues found! 🎉"
picklescan -p malicious_pkgmod.pt # -> "Infected files: 0, Dangerous globals: 0"
# default-API load executes code
rm -f /tmp/huntr_pkgmod_pwned
python load_pkgmod.py # -> marker: True pwned-pkgmod-<user>
cat /tmp/huntr_pkgmod_pwned
Control: the naive __reduce__/posix.system variant of the same archive is flagged CRITICAL by both scanners — proving the evasion is specific to the module-source technique, not an unsupported-format skip.
Files: malicious_pkgmod.pt (PoC), build_malicious_pkgmod.py (craft), load_pkgmod.py (loader), ref_interned.pt (benign reference).