Skip to main content
Vulnerability Database/CVE-2026-112074

CVE-2026-112074: Tencent ncnn Integer Overflow RCE Vulnerability

CVE-2026-112074 is an integer overflow vulnerability in Tencent ncnn that enables remote code execution through the yuv420sp2rgb function. This post explains the technical details, affected versions, and mitigation steps.

Published:

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-112074 Overview

CVE-2026-112074 is an integer overflow vulnerability [CWE-189] in Tencent ncnn, a high-performance neural network inference framework. The flaw resides in the ncnn::yuv420sp2rgb function in src/mat_pixel.cpp, part of the Conversion API. Attacker-controlled input to this image conversion routine triggers an integer overflow during pixel buffer size calculations. The issue affects versions up to commit 44b02dabdcf97499281a4692ebd65bad73dcf8b6. A public exploit has been released, and the project maintainers have not yet responded to the reported issue.

Critical Impact

An integer overflow in the YUV-to-RGB conversion path can corrupt memory calculations in applications that pass untrusted image data to ncnn, potentially leading to out-of-bounds memory access and application instability.

Affected Products

  • Tencent ncnn neural network inference framework
  • All versions up to commit 44b02dabdcf97499281a4692ebd65bad73dcf8b6
  • Applications embedding the ncnn Conversion API for YUV420SP image handling

Discovery Timeline

  • 2026-10-19 - CVE-2026-112074 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-112074

Vulnerability Analysis

The vulnerability resides in the ncnn::yuv420sp2rgb conversion routine within src/mat_pixel.cpp. This function converts YUV420 semi-planar image data into an RGB buffer, a common step before feeding image tensors into neural network inference pipelines. During buffer size computation, arithmetic on width and height parameters wraps around when sufficiently large values are supplied. The resulting undersized allocation or miscalculated stride permits subsequent read or write operations to exceed the intended memory region. The vulnerability is reachable remotely when an application passes attacker-controlled image dimensions or data to the Conversion API.

Root Cause

The root cause is unchecked integer arithmetic [CWE-189] on image dimension parameters used to compute buffer sizes in yuv420sp2rgb. When multiplied values exceed the maximum representable integer, the result wraps to a small value. Downstream allocation and copy logic then operate on a buffer smaller than the actual pixel data, producing out-of-bounds memory access during the conversion loop.

Attack Vector

Exploitation requires an application built on ncnn to accept image input from a remote or untrusted source and invoke the vulnerable conversion function. User interaction is required, typically in the form of loading or processing a crafted image. A public proof-of-concept has been released referenced in GitHub ncnn Issue #7035 and tracked in VulDB CVE-2026-112074.

No verified exploit code is reproduced here. See the GitHub ncnn Issue #7035 for technical details on triggering the overflow condition.

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 Attempts

Detection Methods for CVE-2026-112074

Indicators of Compromise

  • Unexpected crashes or segmentation faults in processes linking against ncnn when handling image inputs
  • Application logs indicating failures within the yuv420sp2rgb or related Conversion API code paths
  • Malformed or oversized YUV420SP image payloads received from untrusted sources

Detection Strategies

  • Inventory applications and services linking the Tencent ncnn library and identify versions at or before commit 44b02dabdcf97499281a4692ebd65bad73dcf8b6
  • Instrument builds of ncnn with AddressSanitizer or UndefinedBehaviorSanitizer during testing to surface overflow conditions in src/mat_pixel.cpp
  • Monitor for abnormal crash telemetry in ML inference workloads that process user-supplied images

Monitoring Recommendations

  • Alert on repeated process termination events for binaries that embed ncnn
  • Log and review image dimensions passed to inference endpoints, flagging values that approach integer limits
  • Correlate crash dumps with network ingress of image data to identify remote exploitation attempts

How to Mitigate CVE-2026-112074

Immediate Actions Required

  • Identify all deployments and applications bundling Tencent ncnn and record the exact commit or release in use
  • Restrict exposure of ncnn-based inference endpoints to untrusted networks until a fix is applied
  • Validate image dimensions and payload sizes at the application boundary before invoking ncnn Conversion APIs

Patch Information

No vendor patch has been published at the time of CVE assignment. The maintainers have been informed through GitHub ncnn Issue #7035 but have not yet responded. Monitor the GitHub ncnn Project repository for an upstream fix and rebuild dependent applications once a corrected release is available.

Workarounds

  • Enforce strict upper bounds on image width and height before passing data into the ncnn Conversion API
  • Reject or pre-process YUV420SP inputs from untrusted sources through a validated converter outside of ncnn
  • Isolate ncnn inference workloads in sandboxed processes to contain the impact of memory corruption
bash
# Example input validation applied before invoking ncnn conversion
# Reject images whose dimension product could overflow 32-bit arithmetic
MAX_PIXELS=16777216   # 4096 x 4096 cap
if [ $(( WIDTH * HEIGHT )) -gt $MAX_PIXELS ]; then
  echo "Rejecting oversized image: ${WIDTH}x${HEIGHT}"
  exit 1
fi

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.