Torch Export trigger backdoor security PoC
This repository contains a benign security research proof-of-concept for the Huntr Model File Vulnerability program.
It demonstrates a .pt2 Torch Export artifact whose exported graph carries trigger-specific output manipulation. The malicious file loads with torch.export.load(...); the trigger executes during normal exported-module inference.
Files:
control_torch_export_classifier.pt2malicious_torch_export_trigger.pt2reproduce.pyrequirements.txt
Reproduction:
python -m venv /tmp/torch-export-trigger-poc-venv
. /tmp/torch-export-trigger-poc-venv/bin/activate
pip install -r requirements.txt
curl -L -O https://huggingface.co/hacnho/torch-export-trigger-backdoor-poc/resolve/main/control_torch_export_classifier.pt2
curl -L -O https://huggingface.co/hacnho/torch-export-trigger-backdoor-poc/resolve/main/malicious_torch_export_trigger.pt2
curl -L -O https://huggingface.co/hacnho/torch-export-trigger-backdoor-poc/resolve/main/reproduce.py
python reproduce.py control_torch_export_classifier.pt2 malicious_torch_export_trigger.pt2
Expected result:
- benign classes match between the control and malicious exports
- trigger row
[1337, -1337]flips from class1to class0 modelscan==0.8.8reportsNo issues found!while skipping the.pt2file
Public file URLs:
- https://huggingface.co/hacnho/torch-export-trigger-backdoor-poc/resolve/main/control_torch_export_classifier.pt2
- https://huggingface.co/hacnho/torch-export-trigger-backdoor-poc/resolve/main/malicious_torch_export_trigger.pt2
- https://huggingface.co/hacnho/torch-export-trigger-backdoor-poc/resolve/main/reproduce.py
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support