Description
darknet subscripts its layer array with an index taken from a configuration file without checking it against the array's length. The array is allocated in src-lib/darknet_network.cpp as xcalloc(net.n, sizeof(Darknet::Layer)), sized to exactly the number of layer sections the file declares. The shortcut, scale_channels and sam sections supply that index through their from field and the route section through its layers field, and parse_shortcut_section in src-lib/darknet_cfg.cpp reads net.layers[index].outputs with no bounds check, which reads past the allocation. The dispatch loop in create_network then reuses the same index to assign net.layers[l.index].use_bin_output and net.layers[l.index].keep_delta_gpu, writing past the allocation at an offset the file controls, with a fixed one-byte value. Parsing a crafted configuration file is sufficient: the parse runs before any weights file is opened and needs no non-default option, so the result is a reliable crash and a write whose location, though not its value, is chosen by whoever supplied the file.
Published: 2026-08-27
Score: 6.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Out-of-bounds memory corruption
Action: Apply patch
AI Analysis

Impact

Darknet 6.0 parses configuration (.cfg) files to build a neural network. The parser extracts a layer index from the file and uses it directly to read and later write into the layer array that has been allocated to match the number of layers declared. Because the index is never bounded, a configuration file crafted with an out‑of‑range value causes the parser to read past the end of the array and then write a single byte at an attacker‑controlled offset. The defect therefore produces a reliable crash and corrupts memory, but the official advisory does not provide evidence that it can be used to execute arbitrary code or elevate privileges.

Affected Systems

This vulnerability affects the hank‑ai Darknet distribution, specifically version 6.0 where the parser and network initialization code allocate the layer array without bounds checking.

Risk and Exploitability

The CVSS score of 6.9 labels the issue as a moderate severity problem. EPSS is not reported, and the vulnerability is not listed in the CISA KEV catalog, indicating no known widespread exploitation. An attacker would need to supply a malicious configuration file that is processed before the weight files are loaded; access could be local if an attacker can write to the configuration directory, or remote if an application accepts externally supplied .cfg files. The lack of evidence for arbitrary code execution suggests the immediate risk is a denial‑of‑service via crash and potential memory corruption, but the fixation patterns could be leveraged as a foothold in more complex attacks if additional vulnerabilities exist.

Generated by OpenCVE AI on August 27, 2026 at 19:13 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to a Darknet release that includes bounds checks for layer indices in the .cfg parser.
  • Restrict which users or processes can create or modify .cfg files, ensuring only trusted administrators or scripts can write the configuration.
  • Implement custom validation to verify that every layer index read from a .cfg file falls within the valid range of the layer array before invoking the parser.

Generated by OpenCVE AI on August 27, 2026 at 19:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 27 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
First Time appeared Hank-ai
Hank-ai darknet
Vendors & Products Hank-ai
Hank-ai darknet

Thu, 27 Aug 2026 16:45:00 +0000

Type Values Removed Values Added
Description darknet subscripts its layer array with an index taken from a configuration file without checking it against the array's length. The array is allocated in src-lib/darknet_network.cpp as xcalloc(net.n, sizeof(Darknet::Layer)), sized to exactly the number of layer sections the file declares. The shortcut, scale_channels and sam sections supply that index through their from field and the route section through its layers field, and parse_shortcut_section in src-lib/darknet_cfg.cpp reads net.layers[index].outputs with no bounds check, which reads past the allocation. The dispatch loop in create_network then reuses the same index to assign net.layers[l.index].use_bin_output and net.layers[l.index].keep_delta_gpu, writing past the allocation at an offset the file controls, with a fixed one-byte value. Parsing a crafted configuration file is sufficient: the parse runs before any weights file is opened and needs no non-default option, so the result is a reliable crash and a write whose location, though not its value, is chosen by whoever supplied the file.
Title darknet through 6.0 Out-of-Bounds Read and Write via Unchecked Layer Index in .cfg Parser
Weaknesses CWE-125
CWE-787
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H'}

cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-27T19:23:22.461Z

Reserved: 2026-08-26T17:44:26.831Z

Link: CVE-2026-81334

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-27T17:20:53.683

Modified: 2026-08-27T20:18:50.083

Link: CVE-2026-81334

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-27T19:15:03Z

Weaknesses