Prusa Research PrusaSlicer Admesh stl_fix_normal_directions() out-of-bounds write vulnerability
An out-of-bounds write vulnerability exists in the Admesh stl_fix_normal_directions() functionality of PrusaSlicer. A specially crafted AMF file can trigger a heap-based buffer overflow, potentially leading to code execution.
Originally disclosed on Cisco Talos
An out-of-bounds write vulnerability exists in the Admesh stlfixnormaldirections() functionality of Prusa Research PrusaSlicer 2.2.0 and Master (commit 4b040b856). A specially crafted AMF file can lead to code execution.
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 reversed_ids vector is sized to the number of facets, but the loop can write to it more than that many times because the same facet may be reversed multiple times, leading to an out-of-bounds write.
Impact
An attacker could potentially execute arbitrary code by convincing a victim to open a malicious AMF file.
What the attacker needed
Victim opens a malicious AMF file
How it was found
- Craft an AMF file with a specific layout of connected triangles that causes repeated reversal of the same facet.
- Open the malicious AMF file in PrusaSlicer.
- The parser processes the volume and calls stl_fix_normal_directions().
- The function writes beyond the allocated reversed_ids vector, causing a heap buffer overflow.
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.
PrusaSlicer is a program that prepares 3D models for printing. It reads model files and processes them. A bug in how it handles certain model files can cause it to write data beyond the memory it reserved, which could let an attacker run their own code on your computer if you open a malicious file.
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.