LibreDWG's OLE2FRAME use-after-free starts with a malicious DXF
GNU LibreDWG 0.14 before 0.15 contains a heap use-after-free in DXF import. CVE-2026-138381 describes the flaw in in_dxf.c where the OLE2FRAME oleclient pointer references memory after it has been freed. The public record rates the issue 6.9 Medium using CVSS 4.0 and notes local attack, passive user interaction, low confidentiality impact and high availability impact.
DXF is a data interchange format. A user may receive a drawing from a client, upload it to a converter, or process it in an automated pipeline. The dangerous object is not a macro-enabled document in this case. The parser itself mishandles a structured entity while reading the file. A malformed OLE2FRAME can crash the importing process or cause freed heap data to appear in exported output. The advisory does not establish a reliable remote code execution path.
Defenders should treat file parsing as an input boundary. Update LibreDWG to 0.15 or a later supported release and verify the package version used by every converter, preview service, command-line tool, and application that embeds the library. A system update to a different package does not prove that a bundled copy changed.
If immediate upgrade is impossible, isolate file-conversion workers from interactive desktops and sensitive networks. Run them under low-privilege accounts with limited file access. Reject untrusted DXF files that exceed expected size or structure limits. Keep crash dumps controlled because they may contain freed heap content. Do not retry the same malformed file in a production worker after a crash; preserve it for analysis and route it through an approved test environment.
Look for crashes in the DXF import path, abnormal converter exits, heap diagnostics, unexpected output artifacts, and repeated processing of the same file. Correlate those events with mail attachments, upload records, API requests, and workflow job IDs. A crash may be the only visible evidence, so availability monitoring should distinguish parser failures from normal invalid-file rejection.
Developers can reduce future exposure by using fresh output buffers, clearing pointers after free, and testing every supported entity type with malformed and truncated inputs. Fuzzing should cover OLE2FRAME and nearby object reconstruction paths, not only the most common drawing entities.
The patch is small in version-number terms and operationally easy to miss. The article's practical question is not whether the library is internet-facing. It is who parses untrusted CAD files and which process identity carries that work.
