libigl readOFF stack-based buffer overflow vulnerabilities
Multiple stack-based buffer overflows exist in libigl's readOFF function because fscanf is used with unbounded format strings on fixed-size stack buffers. A crafted .off file can overflow these buffers, potentially allowing arbitrary code execution.
Multiple stack-based buffer overflow vulnerabilities exist in the readOFF.cpp functionality of libigl v2.4.0. A specially-crafted .off file can lead to a buffer overflow.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code uses fscanf with format specifiers that do not limit the number of characters written, causing writes past the end of fixed-size stack buffers.
Impact
An attacker could achieve arbitrary code execution by convincing a victim to open a malicious .off file.
What the attacker needed
Victim opens a malicious .off file
The fix
The fscanf format strings should be bounded to the buffer size, and the tic_tac_toe buffer should be at least two bytes to accommodate the null terminator, or the characters should be ignored with an asterisk.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A buffer overflow happens when a program writes more data into a fixed-size memory space than it can hold, spilling into nearby memory. Here, the library reads a file and copies text into small buffers without checking length, so a malicious file can overwrite memory and possibly let an attacker run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.