Views
No views yet
hank-ai/darknet) .cfg anchors= parsing.cfg) triggers an attacker-controlled heap
out-of-bounds write at model-load time. While parsing the [yolo] (or [Gaussian_yolo])
section, Darknet copies every value of the anchors= option into a biases buffer that is only
num*2 floats long, with no bounds check on the copy loop.src-lib/darknet_cfg.cpp:1716-1719 ([yolo]) and :2139-2143
([Gaussian_yolo]) copy find_float_array("anchors") (unbounded length) into
l.biases = xcalloc(num*2, sizeof(float)) (src-lib/yolo_layer.cpp:372 /
gaussian_yolo_layer.cpp:383). The sibling [region] parser (:2047-2051) clamps with
&& i < num*2 and is not affected — proving the missing bound is the defect.load_network / parse_network_cfg), before any
inference or weights read.gen_evil_cfg.py — generates evil_yolo_anchors.cfg (num=1 ⇒ 8-byte buffer; 256 anchors ⇒
1016-byte controlled overflow).poc_harness.cpp — minimal loader; calls the public C API load_network_custom().build_poc.sh — clones (if needed), builds the in-scope parser with AddressSanitizer (CPU-only),
builds the harness, generates the model, and runs it.asan_run.log — captured ASAN output: heap-buffer-overflow WRITE of size 4../build_poc.shWRITE of size 4 past a num*2-float allocation, with
the write originating in parse_yolo_section (darknet_cfg.cpp).