libigl readNODE out-of-bounds write vulnerability
An out-of-bounds write vulnerability exists in libigl's readNODE function when parsing a .node file where the header declares fewer points than the file contains. An attacker can provide a malicious file to trigger the vulnerability, leading to memory corruption.
Originally disclosed on Cisco Talos
An out-of-bounds write vulnerability exists in the readNODE functionality of libigl v2.5.0. A specially crafted .node file can lead to an out-of-bounds write.
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 resizes output arrays based on the declared number of points but then writes to them using an index that increments for each line in the file without checking if the index exceeds the array size.
Impact
An attacker could cause memory corruption, potentially leading to code execution or a crash, by providing a malicious .node file.
What the attacker needed
Victim opens a malicious .node file
How it was found
- Create a .node file with a header declaring fewer points than the number of lines that follow.
- Open the file with a program that uses libigl's readNODE function.
- The function resizes arrays based on the header count.
- As it reads each line, it increments an index and writes to the arrays without bounds checking.
- When the number of lines exceeds the declared count, an out-of-bounds write occurs.
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.
This report describes a bug in a library that reads 3D model files. The program trusts a number written at the top of the file that says how many points there are, but if the file actually has more points, the program writes past the end of its memory buffer, which can crash or corrupt data.
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.