Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft .cfg with overflow-inducing dimensions
-
DeliveryDeliver .cfg to target pipeline or user
-
ExploitDarknet loads .cfg and computes undersized xcalloc size
-
ExecutionAllocation returns too-small heap buffer
-
Persistforward_convolutional_layer accesses beyond allocation boundary
-
ImpactHeap metadata corruption enabling potential code execution
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The attacker must be able to supply or influence a .cfg configuration file that the target darknet process loads. The CVSS 4.0 vector (AV:L/UI:P) confirms this is a local attack requiring passive user interaction - a user or automated pipeline must initiate loading of the file. No valid .weights file is required; the .cfg alone triggers the overflow during layer initialization. Exploitation is therefore limited to scenarios where untrusted .cfg files can reach a darknet process, such as model-sharing workflows, automated training pipelines that download community configurations, or inference services that accept user-submitted model files. Environments that exclusively load hardcoded or internally-controlled .cfg files face no realistic exploitation risk. The specific limiting factors are: (1) attacker must control or tamper with a .cfg file delivered to the target, (2) the target must invoke darknet to load that file (passive UI), and (3) the dimension product in the .cfg must be crafted to overflow 32-bit signed arithmetic - a deterministic condition requiring knowledge of the vulnerability but no brute force. |
| Impact | The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P, score 8.5) accurately reflects the threat model: an attacker must deliver a crafted .cfg file to a system and induce a process to load it, placing the attack vector in the local domain with passive user interaction. High VC/VI/VA impact is well-founded given that heap metadata corruption in release builds is confirmed by the POC. No EPSS score was supplied in the source intelligence, so exploitation probability cannot be quantified from base-rate data. The vulnerability is not listed in the CISA KEV catalog, meaning no confirmed mass or active exploitation has been observed. However, the existence of a working POC - demonstrating glibc allocator corruption without requiring a valid weights file - meaningfully lowers the bar for exploitation, and any environment that ingests community-sourced or externally-supplied darknet .cfg files should treat remediation as a near-term priority rather than a background task. The attack is local by CVSS vector but 'local' in the darknet context includes model-sharing workflows, training pipelines, and inference services that download and load model configurations from external sources. No CVSS vector inconsistencies are present: AV:L is consistent with the file-loading trigger described. |
| Exploit ScenarioDerived | An attacker crafts a darknet .cfg file specifying, for example, width=256, height=256, and filters=65536, causing the product 256*256*65536 to equal 2^32 and wrap to zero under 32-bit signed arithmetic; xcalloc then allocates a zero- or near-zero-byte heap buffer. When the operator loads this configuration for inference or training - without needing a .weights file - forward_convolutional_layer computes correct GEMM dimensions and immediately reads and writes past the undersized buffer, corrupting heap metadata. The POC referenced in GitHub issue #148 demonstrates this produces a clean glibc allocator crash in release builds, a primitive that skilled attackers may leverage for arbitrary code execution. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 20, 2026
Heap buffer overflow in hank-ai/darknet's convolutional layer initialization corrupts process memory when a crafted .cfg model configuration is loaded, because layer weight and output buffer sizes are derived from unchecked 32-bit integer multiplication of configuration-supplied fields, allowing the product to wrap to zero or a small value. Darknet versions through 6.0 are affected, and no valid .weights file is required to trigger the flaw - the .cfg alone is sufficient. A publicly available proof of concept demonstrates both an out-of-bounds read under AddressSanitizer and glibc allocator metadata corruption in a release build, confirming that exploitation does not require deep reverse engineering.
RemediationAI
No vendor-released patched version has been confirmed at time of analysis; consumers should monitor the upstream repository at https://github.com/hank-ai/darknet and the VulnCheck advisory at https://www.vulncheck.com/advisories/darknet-integer-overflow-in-convolutional-layer-buffer-sizing-leads-to-heap-buffer-overflow for patch availability. The most direct compensating control is to validate all .cfg configuration field values - specifically c, groups, n, size, out_h, out_w, and out_c - against safe maximum bounds before layer initialization, checking that no intermediate product exceeds INT_MAX; this can be applied as a patch to the upstream source at the xcalloc call sites. Pipelines that ingest externally-supplied or community-contributed .cfg files should be sandboxed (container with seccomp, or a dedicated low-privilege process) to contain the impact of any heap corruption to the inference subprocess rather than the host. The most conservative mitigation is to restrict .cfg ingestion to configurations sourced exclusively from trusted, internally-controlled repositories until a patched release is available. Building darknet with AddressSanitizer in staging environments will surface exploitation attempts at the cost of a runtime performance reduction of roughly 2x.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Darknet is a C/C++ neural network framework primarily associated with YOLO-family object detection models. The affected code in src-lib/convolutional_layer.cpp computes l.nweights as (c / groups) * n * size * size and l.outputs as l.out_h * l.out_w * l.out_c using native 32-bit signed integer arithmetic before passing the result directly to xcalloc. CWE-190 (Integer Overflow or Wraparound) describes this exact pattern: when the true mathematical product exceeds INT_MAX (2,147,483,647), the signed result wraps to a small or negative value, causing xcalloc to allocate far less memory than the network forward pass requires. The root cause is compounded by an operand-order discrepancy: forward_convolutional_layer re-derives the GEMM operand k as l.size*l.size*l.c/l.groups - dividing after multiplying - whereas the allocation divided first, yielding a larger effective dimension than was allocated for. The CPE string cpe:2.3:a:hank-ai:darknet:*:*:*:*:*:*:*:* covers all releases; the vulnerable lines are confirmed at v6.0 via GitHub source references at convolutional_layer.cpp lines 764, 811, and 1457.
Know when Darknet gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
File loading requires user interaction (UI:R) but no privileges; heap corruption is scoped to the vulnerable process with no scope change (S:U).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Executive ViewAI
Darknet (versions through 6.0), an open source machine learning framework used in computer vision applications, contains a critical code execution vulnerability triggered by loading malicious model configuration files without requiring authentication; publicly available exploit code exists demonstrating exploitation feasibility. Organizations using Darknet for model training or inference operations face immediate risk of system compromise, with no vendor patch currently available. Urgent action to isolate Darknet systems and restrict model file sources is required to prevent exploitation.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) cryptographic signature verification for all .cfg model configuration files from trusted sources; (2) strict execution environment isolation (containers/VMs) with minimal process privileges and network segmentation; (3) allowlisting of approved model repositories with strict input validation; (4) comprehensive audit logging of model file sources and Darknet process execution; (5) disable Darknet if not operationally required; (6) evaluation and migration to alternative, patched ML frameworks.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.
EUVD-2026-63536
GHSA-5277-mwh4-q4cc
NVD
CVE.org
EPSS
Exploit-DB