AutoDesk AutoCAD 2019 LinetypeTableRecord Code Execution Vulnerability
A use-after-free flaw in AutoCAD 2019's DXF parser lets a crafted drawing file free a memory region without reallocating it, leaving a dangling pointer that is later used to call a virtual function. An attacker who controls that freed memory could achieve arbitrary code execution when the file is opened.
Originally disclosed on Cisco Talos
An exploitable use-after-free vulnerability exists in the DXF-parsing functionality of AutoDesk AutoCAD 2019. A specially crafted DXF file can cause a use-after-free vulnerability, resulting in 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
Likely the parser frees the element array when a LinetypeTableRecord declares zero elements but does not clear the pointer at offset 0x50, so destruction later dereferences the stale pointer.
Impact
An attacker could achieve arbitrary code execution in the context of the AutoCAD process, though the user must open a malicious file.
What the attacker needed
Victim opens a crafted DXF file; AutoCAD 2019 on Windows
How it was found
- Craft a DXF file containing a LinetypeTableRecord whose element count is zero.
- Open the crafted file in AutoCAD 2019 so the parser processes the record.
- The parser frees the existing element array but skips allocation because the count is not greater than zero.
- When the LinetypeTableRecord is destroyed, the stale pointer at offset 0x50 is dereferenced and a vtable function is called.
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 throws away a piece of memory but keeps a pointer to it and later uses that pointer as if the memory were still valid. Here a drawing file can make the program free a block of memory and then, when the drawing is closed, call a function through a pointer stored in that freed block. If an attacker can put their own data in that freed space, they can make the program run their 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.