CVE-2026-71266: tinyobjloader-c Stack Buffer Overflow in MTL Material File Line Parsing
tinyobjloader-c's tinyobjparseandindexmtlfile() (tinyobjloaderc.h) reads each line of a .mtl material file into a fixed 4096-byte stack buffer linebuf via memcpy(linebuf, p, plen), guarded only by assert(plen < 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.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-71266?
CVE-2026-71266 has a high severity score of 7.8.
What is the nature of the vulnerability in CVE-2026-71266?
CVE-2026-71266 is a stack buffer overflow vulnerability that occurs during MTL material file line parsing.
How do I fix CVE-2026-71266?
To mitigate CVE-2026-71266, ensure that the input size is validated before copying data into the buffer.
What software is affected by CVE-2026-71266?
CVE-2026-71266 affects tinyobjloader and tinyobjloader-c.
What happens if CVE-2026-71266 is exploited?
Exploitation of CVE-2026-71266 could lead to remote code execution or application crashes.