Heap-double-free vulnerability in libredwg

libredwg Updated 02 Oct 2025

Summary

25/10/2023
HIGH
Yes i
High
Not published

OSV-2023-1063: Heap-double-free in dwg_free_object. Affects libredwg versions >= 9811e30555064b7b560c326dd2cbb200e2e6a6f6, < 9801c8580ecabfd5770f927e5d71b0d1d184a55c. Fixed in 9801c8580ecabfd5770f927e5d71b0d1d184a55c. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

LibreDWG is an open-source library for reading and writing DWG files, which are the native file format for AutoCAD. It provides functionality to parse and manipulate DWG files, making it a crucial component for applications that work with AutoCAD files. However, a vulnerability has been discovered in the library that could lead to a heap-double-free error.

Vulnerability Detail

The heap-double-free vulnerability in libredwg arises from a flaw in the dwg_free_object function. This flaw can be triggered when the function attempts to free an object that has already been freed, leading to memory corruption. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial-of-service condition. The vulnerability has been assigned a high severity rating.

How To Fix

Minimum fixed version

9801c8580ecabfd5770f927e5d71b0d1d184a55c

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 workaround, developers can avoid using the dwg_free_object function until the library is updated with the fix. Instead, they can implement their own memory management for freeing objects to mitigate the risk of triggering the heap-double-free vulnerability.

Conclusion

The heap-double-free vulnerability in libredwg can be addressed by updating the library to a version that includes the fix. Developers can also implement their own memory management as a workaround until the update is applied. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libredwg →

Share this vulnerability

FAQ

LibreDWG is an open-source library for reading and writing DWG files, the native file format for AutoCAD. It provides functionality to parse and manipulate DWG files, making it a crucial component for applications that work with AutoCAD files.

A heap-double-free vulnerability occurs when a program attempts to free a memory object that has already been freed. This can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a denial-of-service condition.

An attacker can exploit this vulnerability by crafting a malicious DWG file that triggers the heap-double-free error in the dwg_free_object function. By exploiting this vulnerability, the attacker may be able to execute arbitrary code or crash the application.

This vulnerability has been assigned a high severity rating due to its potential to allow arbitrary code execution or cause a denial-of-service condition.

To protect your application from this vulnerability, it is recommended to update the libredwg library to a version that includes the fix. Additionally, you can implement proper input validation and sanitization to mitigate the risk of processing malicious DWG files.

Related vulnerabilities

Recent vulnerabilities recorded for libredwg.

How To Fix

Minimum fixed version

9801c8580ecabfd5770f927e5d71b0d1d184a55c

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback