CVE-2026-72852: Integer Overflow or Wraparound in hank-ai darknet
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.
CVSS v4.0
Score 8.5high
Affected software
hank-ai
darknet
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The hank-ai darknet software computes buffer sizes for convolutional layers by multiplying configuration fields from a .cfg file using unchecked 32-bit integer arithmetic. Specifically, l.nweights is calculated as (c / groups) * n * size * size and l.outputs as l.out_h * l.out_w * l.out_c, both feeding directly into xcalloc for memory allocation. If the product of these dimensions exceeds INT_MAX, the value wraps around to a small or zero number, causing an undersized allocation. For example, a width and height of 256 combined with 65536 filters results in a 2^32 product that wraps to zero. Later, forward_convolutional_layer recalculates GEMM dimensions differently, leading to out-of-bounds reads and writes on the undersized buffer. Loading a maliciously crafted .cfg file alone is sufficient to trigger this vulnerability, without requiring a valid weights file. Proof-of-concept testing showed heap buffer overflow reads and glibc allocator metadata corruption, confirming out-of-bounds memory access.
Potential Impact
This vulnerability can lead to heap buffer overflows during convolution operations, causing memory corruption and potential crashes or arbitrary code execution. The flaw arises from integer overflow in buffer size calculations, resulting in undersized allocations and out-of-bounds memory access. Successful exploitation requires loading a specially crafted .cfg file, which can trigger the vulnerability during inference or training. No valid weights file is necessary. The high CVSS score of 8.5 reflects the significant impact on confidentiality, integrity, and availability.
Mitigation Recommendations
No vendor advisory or patch information is provided. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid loading untrusted or crafted .cfg files into hank-ai darknet. Implement input validation or size checks on configuration parameters to prevent integer overflow conditions.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-10T15:16:31.371Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a874977acd9273b49fe8a0d
Added to database: 08/20/2026, 18:37:43 UTC
Last enriched: 09/25/2026, 02:39:44 UTC
Last updated: 10/05/2026, 06:48:18 UTC
Views: 64
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.