Slic3r libslic3r TriangleMesh clone heap-based buffer overflow vulnerability
A heap-based buffer overflow exists in the TriangleMesh clone functionality of Slic3r libslic3r. A specially crafted STL file can trigger the overflow, potentially leading to code execution or a crash.
Originally disclosed on Cisco Talos
A heap-based buffer overflow vulnerability exists in the TriangleMesh clone functionality of Slic3r libslic3r 1.3.0 and Master Commit b1a5500. A specially-crafted STL file can lead to a heap 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 copy constructor copies the facets_malloced count without adjusting it to the actual allocated size after degenerate facets are removed, so later code believes there is more space than actually exists.
Impact
An attacker could cause a heap buffer overflow, potentially leading to code execution or a crash.
What the attacker needed
Malicious STL file; victim opens file in Slic3r
How it was found
- Craft an STL file that causes degenerate facets to be removed during topology check.
- Load the STL file into Slic3r, triggering the TriangleMesh copy constructor.
- The copy constructor allocates a smaller array but copies the larger facets_malloced value.
- When adding a facet, the check against facets_malloced passes, and a write occurs beyond the allocated buffer.
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 memory corruption bug in a 3D printing program. When the program reads a specially crafted 3D model file, it miscounts how much memory it needs and writes data past the end of a buffer, which can crash the program or 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.