Executive brief
A security vulnerability has been identified in GNU libredwg, a library used for reading and writing DWG files (the native format for CAD software like AutoCAD). An attacker could provide a specially crafted DWG file that, when processed by the library or its associated utilities, causes the application to crash or potentially allow unauthorized access to data. This could lead to service disruptions or the compromise of sensitive design files.
Technical details
A heap-based buffer overflow exists in GNU libredwg versions up to 0.13.4.8160 within the bit_read_RC function in bits.c. The vulnerability is triggered during the decompression of R2004 compressed sections when processing malformed DWG files via the dwgbmp utility. An attacker can exploit this remotely by providing a crafted DWG file, leading to an out-of-bounds read/write. This issue is a result of an incomplete fix for previous decompression overflows where address and size wrapping were not properly validated against the decompression buffer size. A patch has been released in commit 8f03865f37f5d4ffd616fef802acc980be54d300 to add the necessary bounds checks.
Affected products
- GNU libredwg up to 0.13.4.8160
Timeline
- 2026-04-22: disclosed: Issue reported on GitHub by HackC0der
- 2026-05-27: advisory: NVD publication date
- 2026-05-27: patched: Patch commit 8f03865f37f5d4ffd616fef802acc980be54d300 identified
References
- https://github.com/HackC0der/CVE-Repos/blob/main/libredwg/libredwg_6d6a339_heap_oob_write_read_2004_compressed_section.dwg
- https://github.com/LibreDWG/libredwg/commit/8f03865f37f5d4ffd616fef802acc980be54d300
- https://github.com/LibreDWG/libredwg/issues/1248
- https://vuldb.com/submit/818197
- https://vuldb.com/vuln/365678
- https://vuldb.com/vuln/365678/cti
- https://www.gnu.org/