CVE-2026-71266

tinyobjloader-c Stack Buffer Overflow in MTL Material File Line Parsing

Published Aug 5, 2026 CVSS 3.1 · 7.8 High EPSS < 1% KEV · Not listed
Description
tinyobjloader-c's tinyobj_parse_and_index_mtl_file (tinyobj_loader_c.h) reads each line of a .mtl material file into a fixed 4096-byte stack buffer via memcpy(linebuf, p, p_len), guarded only by . The identical vulnerable pattern is duplicated in a second function in the same file.

Analysis

AI-generated

Technical impact

tinyobjloader‑c’s tinyobj_parse_and_index_mtl_file reads each line of a .mtl material file into a fixed 4096‑byte stack buffer via memcpy, without performing explicit bounds checking; the code only references a guard that is not enforced in release builds. This permits an attacker to supply a line longer than 4096 bytes and overflow the buffer, potentially corrupting adjacent stack data such as the name buffer and other control structures. Such stack corruption can lead to return address overwrite or other control‑flow hijack, allowing arbitrary code execution or, at minimum, a denial of service. The vulnerability is present in both parsing functions in the same file.

Affected Systems

The vulnerability affects the syoyo tinyobjloader‑c library. Any application that links against this library and loads attacker‑supplied .mtl files is potentially impacted. No specific version numbers are listed, implying all releases containing the vulnerable parsing functions are affected.

Risk and Exploitability

The CVSS score of 7.8 indicates a high severity, and the EPSS score of < 1% does not diminish the threat because the flaw is readily exploitable with a crafted file. The vulnerability does not appear in the CISA KEV catalog, but the stack overflow can be triggered by a local attacker who can supply input to the application. The likely attack vector is the delivery of a malicious .mtl file through ordinary user‑controlled file loading.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the tinyobjloader‑c library to a patched release that removes the fixed 4096‑byte buffer or adds bounds checking.
  • Validate all .mtl input lines to ensure they do not exceed 4095 characters before calling the parsing routine.
  • Compile or configure the application with stack protection mechanisms such as –fstack‑protector and canaries to detect and mitigate stack overflows.

Generated by OpenCVE AI on August 10, 2026 at 20:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description tinyobjloader-c's tinyobj_parse_and_index_mtl_file() (tinyobj_loader_c.h) reads each line of a .mtl material file into a fixed 4096-byte stack buffer `linebuf` via memcpy(linebuf, p, p_len), guarded only by `assert(p_len < 4095)`. Because assert() compiles to a no-op under -DNDEBUG (standard for release builds), a crafted .mtl file containing a line (e.g. a "newmtl" material name) longer than 4096 bytes overflows linebuf into the adjacent stack variable namebuf and beyond, corrupting the stack of any application that loads attacker-supplied 3D model/material files. The identical vulnerable pattern is duplicated in a second function in the same file. tinyobjloader-c's tinyobj_parse_and_index_mtl_file (tinyobj_loader_c.h) reads each line of a .mtl material file into a fixed 4096-byte stack buffer via memcpy(linebuf, p, p_len), guarded only by . The identical vulnerable pattern is duplicated in a second function in the same file.
Title tinyobjloader-c - Stack Buffer Overflow in MTL Material File Line Parsing tinyobjloader-c Stack Buffer Overflow in MTL Material File Line Parsing
Type Values Removed Values Added
Title tinyobjloader-c Stack Buffer Overflow in MTL Material File Line Parsing tinyobjloader-c - Stack Buffer Overflow in MTL Material File Line Parsing
Type Values Removed Values Added
First Time appeared Syoyo
Syoyo tinyobjloader-c
Vendors & Products Syoyo
Syoyo tinyobjloader-c
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
Description tinyobjloader-c's tinyobj_parse_and_index_mtl_file() (tinyobj_loader_c.h) reads each line of a .mtl material file into a fixed 4096-byte stack buffer `linebuf` via memcpy(linebuf, p, p_len), guarded only by `assert(p_len < 4095)`. Because assert() compiles to a no-op under -DNDEBUG (standard for release builds), a crafted .mtl file containing a line (e.g. a "newmtl" material name) longer than 4096 bytes overflows linebuf into the adjacent stack variable namebuf and beyond, corrupting the stack of any application that loads attacker-supplied 3D model/material files. The identical vulnerable pattern is duplicated in a second function in the same file.
Title tinyobjloader-c Stack Buffer Overflow in MTL Material File Line Parsing
Weaknesses CWE-121
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-121

    Stack-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
TuranSec
Published
Updated
Aug 10, 2026, 11:46 AM
Reserved
Aug 5, 2026, 12:23 PM
Status
Deferred
Published
Aug 5, 2026, 1:24 PM
Modified
Oct 24, 2026, 3:10 PM