Skip to content
Memory corruption Advisory Advanced CVE-2021-21900

LibreCad libdxfrw dxfRW::processLType() use-after-free vulnerability

A use-after-free vulnerability exists in the dxfRW::processLType() function of LibreCad libdxfrw when parsing a specially crafted .dxf file. An attacker could exploit this to achieve code execution.

Lilith >_> Follow

Originally disclosed on Cisco Talos

High 8.8 View original

A code execution vulnerability exists in the dxfRW::processLType() functionality of LibreCad libdxfrw 2.2.0-rc2-19-ge02f3580. A specially-crafted .dxf file can lead to a use-after-free vulnerability.

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 DRW_TableEntry::reset() function frees the extData objects but does not set the curr pointer to null, leaving it dangling.

Impact

This could lead to code execution, as the use is on a function pointer whose first argument is fully controlled.

What the attacker needed

Victim opens a malicious .dxf file

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.

A use-after-free happens when a program frees memory but keeps using it, like deleting a file but still opening it. Here, a malicious .dxf file tricks the program into freeing an object and then writing to it, which can 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.

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.