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.pt2
  • malicious_torch_export_trigger.pt2
  • reproduce.py
  • requirements.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 class 1 to class 0
  • modelscan==0.8.8 reports No issues found! while skipping the .pt2 file

Public file URLs:

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support