Heap Buffer Overflow Vulnerability in libredwg: Critical Security Risk
Summary
OSV-2026-892: Heap-buffer-overflow in decode_R13_RNUMBER. Affects libredwg across 2 version ranges.
< 0156c780ac6b109d191975041def0a258b0b75fc
>= c89f635505028a11fadb9a0904d2c3bd44f1b23a, < 360ed38a2c4f948689e5f9851a744016928becdc
Fixed in 360ed38a2c4f948689e5f9851a744016928becdc. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
libredwg is an open-source library designed for reading and writing DWG files, which are commonly used in CAD software. The library allows developers to manipulate DWG files programmatically, providing essential functionalities for applications that require CAD data processing. However, like many libraries that handle complex file formats, libredwg is susceptible to vulnerabilities that can lead to severe security risks, including memory corruption and potential code execution.
Vulnerability Detail
The vulnerability identified in libredwg is a heap buffer overflow occurring in the function decode_R13_RNUMBER. This issue arises from improper handling of memory allocation, allowing an attacker to read beyond the allocated buffer. The potential ramifications of this vulnerability include application crashes, data corruption, and exploitation by malicious actors to execute arbitrary code. The vulnerability was reported through OSS-Fuzz, highlighting its critical nature and the need for immediate attention.
How To Fix
Minimum fixed version
360ed38a2c4f948689e5f9851a744016928becdc
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can avoid using the specific function decode_R13_RNUMBER until the library is updated. Additionally, implementing input validation to ensure that data passed to the library is sanitized may help mitigate the risk of exploitation.
Conclusion
The heap buffer overflow vulnerability in libredwg poses a significant security risk that can lead to severe consequences if not addressed. Users are strongly encouraged to update to the patched versions of the library to ensure the integrity and security of their applications. Utilizing tools like Vulert can help in monitoring and managing open-source vulnerabilities effectively.
See every vulnerability recorded for libredwg →
FAQ
A heap buffer overflow occurs when a program writes more data to a buffer located on the heap than it can hold, potentially leading to memory corruption and security vulnerabilities.
You can use Vulert, which monitors open-source vulnerabilities in your software. By simply providing a manifest file like package-lock.json, Vulert can alert you in real-time about any vulnerabilities, including this one.
The risks include application crashes, data corruption, and the potential for attackers to execute arbitrary code, which can lead to unauthorized access or data breaches.
Yes, you can temporarily avoid using the affected function decode_R13_RNUMBER and implement input validation to reduce the risk of exploitation.
Detailed information can be found in the OSS-Fuzz report and the GitHub repository for libredwg, where the vulnerability was documented.
References
Related vulnerabilities
Recent vulnerabilities recorded for libredwg.