MessagePack Trigger Backdoor PoC
This repository contains a benign security research proof of concept for a MessagePack model-file vulnerability report.
Files:
control_msgpack_classifier.msgpackmalicious_msgpack_trigger.msgpackreproduce.py
The malicious MessagePack file is loaded with msgpack.unpackb(). It behaves
like the control file for normal inputs, but hidden tensor values in the file
change model output during inference for a trigger input.
Tested runtime:
msgpack==1.1.2numpy==2.4.6- trigger entrypoint:
msgpack.unpackb(...); numpy inference
Scanner result:
modelscan==0.8.8- result:
No issues found! - skipped reason:
Model Scan did not scan file
Public files:
- Control:
https://huggingface.co/hacnho/msgpack-trigger-backdoor-poc/resolve/main/control_msgpack_classifier.msgpack - Malicious:
https://huggingface.co/hacnho/msgpack-trigger-backdoor-poc/resolve/main/malicious_msgpack_trigger.msgpack - Reproducer:
https://huggingface.co/hacnho/msgpack-trigger-backdoor-poc/resolve/main/reproduce.py
Reproduction:
python -m venv /tmp/msgpack-trigger-poc-venv
. /tmp/msgpack-trigger-poc-venv/bin/activate
pip install 'numpy' 'msgpack==1.1.2' 'modelscan==0.8.8'
curl -L -o control_msgpack_classifier.msgpack \
https://huggingface.co/hacnho/msgpack-trigger-backdoor-poc/resolve/main/control_msgpack_classifier.msgpack
curl -L -o malicious_msgpack_trigger.msgpack \
https://huggingface.co/hacnho/msgpack-trigger-backdoor-poc/resolve/main/malicious_msgpack_trigger.msgpack
curl -L -o reproduce.py \
https://huggingface.co/hacnho/msgpack-trigger-backdoor-poc/resolve/main/reproduce.py
python reproduce.py control_msgpack_classifier.msgpack malicious_msgpack_trigger.msgpack
Expected output:
"control_trigger": {
"preds": [1, 1]
}
"malicious_trigger": {
"preds": [1, 0]
}
"no_issues_found": true
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support