Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-112073 Overview
CVE-2026-112073 is an out-of-bounds read vulnerability in Tencent ncnn, a high-performance neural network inference framework. The flaw resides in the matmul_transb function within src/layer/matmul.cpp, part of the MatMul layer component. Attackers can trigger the condition remotely by supplying crafted input that forces the function to read beyond allocated buffer boundaries. The issue affects ncnn builds up to commit 44b02dabdcf97499281a4692ebd65bad73dcf8b6. A public exploit exists, and the project maintainers have not yet responded to the issue report filed against the repository. The vulnerability is classified under CWE-119, covering improper restriction of operations within memory buffer bounds.
Critical Impact
Remote attackers can trigger an out-of-bounds read in the ncnn MatMul layer, enabling potential information disclosure or process termination in applications performing neural network inference on untrusted inputs.
Affected Products
- Tencent ncnn neural network inference framework
- All builds up to commit 44b02dabdcf97499281a4692ebd65bad73dcf8b6
- Applications embedding ncnn's MatMul layer for model inference
Discovery Timeline
- 2026-10-19 - CVE-2026-112073 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-112073
Vulnerability Analysis
The vulnerability affects ncnn's matrix multiplication layer, which is a core computational primitive used across neural network models. The matmul_transb function performs matrix multiplication with the second operand transposed. When processing model inputs or intermediate tensors whose shape metadata does not match the actual buffer dimensions, the function reads memory beyond the allocated tensor bounds. An attacker who can supply either a crafted model file or crafted inference input to an application using ncnn can trigger the read. Consequences include process crashes affecting availability and potential disclosure of adjacent heap memory containing sensitive data from the hosting application.
Root Cause
The root cause is missing or insufficient bounds validation on tensor dimensions inside the matmul_transb implementation in src/layer/matmul.cpp. The function trusts caller-supplied dimension parameters when indexing into the backing buffers, violating [CWE-119]. When a mismatch exists between declared tensor shape and actual allocation size, the inner loops dereference pointers past the valid memory region.
Attack Vector
Exploitation requires an attacker to influence the inputs processed by an ncnn-based pipeline. In typical deployments this includes loading an untrusted .param or .bin model file, or submitting crafted tensor data to an inference service exposing a network endpoint. User interaction is required in some deployment models where a user must open or submit the malicious artifact. No authentication is required when the inference endpoint is publicly reachable.
Technical details are documented in the public Tencent ncnn Issue #7034 and the VulDB entry for CVE-2026-112073. No sanitized exploitation code is reproduced here.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-112073
Indicators of Compromise
- Unexpected segmentation faults or process termination in services running ncnn inference workloads
- Crash dumps referencing matmul_transb or src/layer/matmul.cpp in the stack trace
- Anomalous model files received from untrusted sources with inconsistent header shape metadata
Detection Strategies
- Audit application dependencies for ncnn versions at or before commit 44b02dabdcf97499281a4692ebd65bad73dcf8b6
- Run ncnn-dependent binaries under AddressSanitizer in test environments to surface out-of-bounds reads during fuzzing of model inputs
- Monitor inference endpoints for malformed tensor payloads and shape metadata that deviates from expected model specifications
Monitoring Recommendations
- Enable crash reporting and core dump capture on hosts running ncnn-based inference services
- Log every model-load operation with the source identity and model file hash to support forensic review
- Alert on repeated inference failures from a single client, which may indicate exploitation attempts
How to Mitigate CVE-2026-112073
Immediate Actions Required
- Restrict ncnn inference endpoints to authenticated internal consumers until a patch is published
- Reject model files and tensor inputs originating from untrusted sources
- Validate tensor shape metadata against expected model schema before invoking inference
- Isolate ncnn worker processes using sandboxing or container-level resource limits to contain crashes
Patch Information
No vendor patch is available at the time of publication. The maintainers have been notified through Tencent ncnn Issue #7034 but have not responded. Track the upstream Tencent ncnn repository for a fix addressing bounds validation in matmul_transb.
Workarounds
- Avoid using the MatMul layer with externally supplied tensors where shape integrity cannot be verified
- Wrap inference calls in a separate process to prevent an out-of-bounds read from affecting the parent application
- Enforce strict allowlists for model file sources and verify cryptographic signatures prior to loading
- Deploy compiler hardening flags such as -fstack-protector-strong and position-independent executables for ncnn builds
# Configuration example: run ncnn inference under a restricted sandbox
systemd-run --uid=ncnn --gid=ncnn \
--property=NoNewPrivileges=yes \
--property=ProtectSystem=strict \
--property=MemoryMax=512M \
/usr/local/bin/ncnn-inference --model /opt/models/trusted.param
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

