Description
ncnn is a high-performance neural network inference framework optimized for the mobile platform. In commit e54f7b1f88434e1d844ea0551b880a1cfb079ce1 and earlier, ncnn allows an out-of-bounds heap write in ncnn::ParamDict::load_param() when Net::load_param() loads a malicious .param model file because the parsed parameter id is checked only against id >= NCNN_MAX_PARAM_COUNT, allowing a negative id to index before the params[NCNN_MAX_PARAM_COUNT] array. This vulnerability is fixed by commit 5a0288f255daa6c3294f77109f67718e434ec020.
Published: 2026-07-15
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability occurs in the ncnn framework when Net::load_param() reads a malicious .param file. The parsed parameter id is only checked against id >= NCNN_MAX_PARAM_COUNT. A negative id bypasses this check and indexes before the params[NCNN_MAX_PARAM_COUNT] array, causing an out‑of‑bounds heap write. This buffer overflow can corrupt adjacent memory, and if the application can be supplied with a crafted model file, it could lead to arbitrary code execution. The issue was fixed by commit 5a0288f255daa6c3294f77109f67718e434ec020.

Affected Systems

The affected product is Tencent ncnn, a mobile‑optimized neural network inference framework. Any build of ncnn that predates the fix commit 5a0288f255 is at risk. No specific version numbers are listed in the input, so users should consider all versions older than the commit as affected.

Risk and Exploitability

The repository lists a CVSS score of 7.1 and an EPSS score of less than 1%, indicating moderate severity but low probability of widespread exploitation. The vulnerability is not included in CISA’s KEV catalog. The attack likely requires an attacker to supply a crafted .param file to the application, so the primary vectors are local or any component that loads user‑supplied model files without trusted validation. If the application runs with elevated privileges or processes untrusted models, the risk escalates.

Generated by OpenCVE AI on July 31, 2026 at 02:51 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade ncnn to a version that includes commit 5a0288f255 or later, which removes the unchecked negative parameter check.
  • If an immediate upgrade is infeasible, restrict the loading of .param files to trusted sources and implement file‑type validation to reject or quarantine unknown or suspicious model files.
  • Audit the application’s model ingestion code to ensure it includes bounds checking for parameter identifiers, and consider adding runtime checks or memory‑safety mechanisms to mitigate potential overflow risks.

Generated by OpenCVE AI on July 31, 2026 at 02:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 30 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Tencent
Tencent ncnn
Vendors & Products Tencent
Tencent ncnn

Fri, 17 Jul 2026 13:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 15 Jul 2026 20:15:00 +0000

Type Values Removed Values Added
Description ncnn is a high-performance neural network inference framework optimized for the mobile platform. In commit e54f7b1f88434e1d844ea0551b880a1cfb079ce1 and earlier, ncnn allows an out-of-bounds heap write in ncnn::ParamDict::load_param() when Net::load_param() loads a malicious .param model file because the parsed parameter id is checked only against id >= NCNN_MAX_PARAM_COUNT, allowing a negative id to index before the params[NCNN_MAX_PARAM_COUNT] array. This vulnerability is fixed by commit 5a0288f255daa6c3294f77109f67718e434ec020.
Title ncnn: Out-of-bounds heap write in ParamDict::load_param via unchecked negative parameter id
Weaknesses CWE-129
CWE-20
CWE-787
References
Metrics cvssV3_1

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


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-17T12:27:10.432Z

Reserved: 2026-06-03T18:49:32.275Z

Link: CVE-2026-50144

cve-icon Vulnrichment

Updated: 2026-07-17T12:26:56.519Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T03:00:06Z

Weaknesses
  • CWE-129

    Improper Validation of Array Index

  • CWE-20

    Improper Input Validation

  • CWE-787

    Out-of-bounds Write