Darknet net-shape overflow assertion PoC
This repository contains a benign security research PoC for a Darknet config
that drives a negative-dimension assertion in cv2.dnn.readNetFromDarknet(...).
Files:
control_same_size.cfgmalicious_h300000_w300000_c3.cfgtiny_shared.weightsreproduce.pyrequirements.txt
Tested environment:
opencv-python==4.13.0.92- runtime
cv2.__version__ == 4.13.0
Observed behavior:
- control config:
- loads successfully
- malicious config:
- with
height=300000,width=300000,channels=3 - raises:
(-215:Assertion failed) s >= 0 in function 'setSize'
- with
Reproduction:
python3 -m venv /tmp/darknet-output-dos
/tmp/darknet-output-dos/bin/pip install -U pip
/tmp/darknet-output-dos/bin/pip install -r requirements.txt
curl -L -O https://huggingface.co/hacnho/darknet-net-shape-overflow-assert-poc/resolve/main/control_same_size.cfg
curl -L -O https://huggingface.co/hacnho/darknet-net-shape-overflow-assert-poc/resolve/main/malicious_h300000_w300000_c3.cfg
curl -L -O https://huggingface.co/hacnho/darknet-net-shape-overflow-assert-poc/resolve/main/tiny_shared.weights
curl -L -O https://huggingface.co/hacnho/darknet-net-shape-overflow-assert-poc/resolve/main/reproduce.py
curl -L -O https://huggingface.co/hacnho/darknet-net-shape-overflow-assert-poc/resolve/main/requirements.txt
/tmp/darknet-output-dos/bin/python reproduce.py --control-cfg control_same_size.cfg --malicious-cfg malicious_h300000_w300000_c3.cfg --weights tiny_shared.weights
Repo state at verification time:
private=false, commit897a9f19329f5a143bcab2f2fdd4d5c559ef6f6f
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support