Executive brief
GNU libredwg is a library for reading and writing DWG (AutoCAD) files. A null pointer dereference vulnerability in the LAYER encoding function can cause the application to crash when processing malformed DWG files, potentially disrupting any tool or service that relies on libredwg for file conversion or manipulation.
Technical details
A null pointer dereference vulnerability exists in the LAYER encoder (dwg_encode_LAYER_private) in src/dwg.spec when encoding to R_2007a or later DWG format. The vulnerable code directly dereferences a LAYER material handle (Dwg_Object_Ref pointer) without first checking if it is NULL. When processing a malformed R2007 DWG file whose LAYER object decodes with a NULL material reference, the encoder attempts a write through the dereferenced NULL pointer (accessing offset 0x0 + offsetof(absolute_ref)), triggering a segmentation fault. The vulnerability requires local file access and a specially crafted or corrupted DWG file as input. The fix (commit f5b548c) restores a NULL-safety check (if (_obj->material)) that was removed in a prior change, ensuring the code follows the file's existing guard convention. Version 0.14 contains the patch.
Affected products
- GNU libredwg 0.13.4
Timeline
- 2026-06-03: disclosed: Issue #1269 reported on GitHub
- 2026-09-14: patched: Fixed in version 0.14 via commit f5b548c4c1697d66c3dabd0f6a49280a14365a3a
- 2026-09-14: advisory: CVE-2026-90622 published