Skip to content
Memory corruption Advisory Advanced CVE-2020-28598

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.

Lilith >_> Follow

Originally disclosed on Cisco Talos

High 8.8 View original

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.

Lilith >_>, 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 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

  1. Craft an AMF file with a specific layout of connected triangles that causes repeated reversal of the same facet.
  2. Open the malicious AMF file in PrusaSlicer.
  3. The parser processes the volume and calls stl_fix_normal_directions().
  4. 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.

More by Lilith >_>

View all

148 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.