---
id: CVE-2026-72852
title: >-
  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
summary: >-
  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 …
severity: high
cvss: 7.8
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'
cwe:
  - CWE-190
  - CWE-787
vendor: hank-ai
product: darknet
affected:
  - darknet <= 6.0
published: '2026-08-20'
updated: '2026-09-24'
sourceUpdated: '2026-09-24T20:43:32.537'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-72852'
references:
  - url: 'https://github.com/hank-ai/darknet'
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/hank-ai/darknet/blob/v6.0/src-lib/convolutional_layer.cpp#L1457
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/hank-ai/darknet/blob/v6.0/src-lib/convolutional_layer.cpp#L764
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/hank-ai/darknet/blob/v6.0/src-lib/convolutional_layer.cpp#L811
    label: disclosure@vulncheck.com
  - url: 'https://github.com/hank-ai/darknet/issues/148'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/darknet-integer-overflow-in-convolutional-layer-buffer-sizing-leads-to-heap-buffer-overflow
    label: disclosure@vulncheck.com
  - url: 'https://github.com/hank-ai/darknet/issues/148'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
tags:
  - nvd
  - cve.org
  - exploit-available
epss: 0.00212
epssPercentile: 0.10283
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-08-25T15:17:31.595040Z'
ingestedAt: '2026-09-24T15:45:56.712Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
