CVE-2026-71266: CWE-121 in syoyo tinyobjloader-c
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.
AI Analysis
Technical Summary
The vulnerability in tinyobjloader-c arises from the function tinyobj_parse_and_index_mtl_file() in tinyobj_loader_c.h, which reads each line of a .mtl material file into a fixed-size 4096-byte stack buffer named linebuf using memcpy. The length check is performed using assert(p_len < 4095), which is compiled out in release builds with -DNDEBUG, effectively removing the protection. Consequently, a maliciously crafted .mtl file containing a line exceeding 4096 bytes can overflow linebuf, corrupting adjacent stack variables such as namebuf and potentially leading to arbitrary code execution or application crashes. An identical vulnerable code pattern exists in a second function within the same source file, compounding the risk. The CVSS v3.1 score is 7.8, reflecting high impact on confidentiality, integrity, and availability with local attack vector, low attack complexity, no privileges required, and user interaction needed.
Potential Impact
Successful exploitation of this vulnerability can lead to stack corruption, which may result in arbitrary code execution, application crashes, or denial of service when processing attacker-controlled 3D model or material files. The vulnerability affects any application using tinyobjloader-c to load .mtl files, potentially compromising the security of the host system. The CVSS score of 7.8 indicates a high severity impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should avoid loading untrusted or unauthenticated .mtl files with tinyobjloader-c. Developers should consider auditing and modifying the code to replace assert-based length checks with proper runtime validation to prevent buffer overflows.
CVE-2026-71266: CWE-121 in syoyo tinyobjloader-c
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.
CVSS v3.1
Score 7.8high
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in tinyobjloader-c arises from the function tinyobj_parse_and_index_mtl_file() in tinyobj_loader_c.h, which reads each line of a .mtl material file into a fixed-size 4096-byte stack buffer named linebuf using memcpy. The length check is performed using assert(p_len < 4095), which is compiled out in release builds with -DNDEBUG, effectively removing the protection. Consequently, a maliciously crafted .mtl file containing a line exceeding 4096 bytes can overflow linebuf, corrupting adjacent stack variables such as namebuf and potentially leading to arbitrary code execution or application crashes. An identical vulnerable code pattern exists in a second function within the same source file, compounding the risk. The CVSS v3.1 score is 7.8, reflecting high impact on confidentiality, integrity, and availability with local attack vector, low attack complexity, no privileges required, and user interaction needed.
Potential Impact
Successful exploitation of this vulnerability can lead to stack corruption, which may result in arbitrary code execution, application crashes, or denial of service when processing attacker-controlled 3D model or material files. The vulnerability affects any application using tinyobjloader-c to load .mtl files, potentially compromising the security of the host system. The CVSS score of 7.8 indicates a high severity impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should avoid loading untrusted or unauthenticated .mtl files with tinyobjloader-c. Developers should consider auditing and modifying the code to replace assert-based length checks with proper runtime validation to prevent buffer overflows.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- TuranSec
- Date Reserved
- 2026-08-05T12:23:34.967Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a7336e4bf8831d539ed9139
Added to database: 08/05/2026, 13:13:08 UTC
Last enriched: 08/05/2026, 13:32:31 UTC
Last updated: 08/05/2026, 16:11:52 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.