Skip to content
Memory corruption Advisory Intermediate CVE-2024-22181

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.

Philippe Laulheret Follow

Originally disclosed on Cisco Talos

High 7.8 View original

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.

Philippe Laulheret, on Cisco Talos

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

  1. Create a .node file with a header declaring fewer points than the number of lines that follow.
  2. Open the file with a program that uses libigl's readNODE function.
  3. The function resizes arrays based on the header count.
  4. As it reads each line, it increments an index and writes to the arrays without bounds checking.
  5. 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.

More by Philippe Laulheret

View all

35 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.