CVE-2020-21831

8.8 HIGH

📋 TL;DR

A heap-based buffer overflow vulnerability in GNU LibreDWG 0.10 allows attackers to execute arbitrary code or cause denial of service by processing specially crafted DWG files. This affects any application or service that uses LibreDWG to handle DWG CAD files. Users and systems processing untrusted DWG files are at risk.

💻 Affected Systems

Products:
  • GNU LibreDWG
Versions: Version 0.10 specifically; earlier versions may also be affected but not confirmed.
Operating Systems: All platforms running LibreDWG (Linux, Windows, macOS, etc.)
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or script using LibreDWG to parse DWG files is vulnerable. This includes CAD tools, file converters, and web services that process DWG files.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the LibreDWG process, potentially leading to full system compromise.

🟠

Likely Case

Application crash (denial of service) when processing malicious DWG files, with potential for code execution in some scenarios.

🟢

If Mitigated

Limited to denial of service if exploit fails or memory protections are in place.

🌐 Internet-Facing: MEDIUM - Risk exists if LibreDWG processes user-uploaded DWG files via web applications or services.
🏢 Internal Only: LOW - Primarily affects users processing CAD files; internal exposure limited to specific workflows.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires the victim to open a malicious DWG file. Public proof-of-concept exists in GitHub issue #188, making weaponization likely.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in versions after 0.10; check latest release (e.g., 0.11 or later).

Vendor Advisory: https://github.com/LibreDWG/libredwg/issues/188

Restart Required: No

Instructions:

1. Update LibreDWG to the latest version from the official repository. 2. Recompile any applications using LibreDWG with the updated library. 3. Replace old LibreDWG installations with the patched version.

🔧 Temporary Workarounds

Disable DWG file processing

all

Temporarily block or avoid processing DWG files with LibreDWG until patched.

Use alternative DWG libraries

all

Switch to alternative CAD file libraries (e.g., Open Design Alliance) if possible.

🧯 If You Can't Patch

  • Restrict DWG file uploads and processing to trusted sources only.
  • Run LibreDWG in a sandboxed or isolated environment to limit potential damage.

🔍 How to Verify

Check if Vulnerable:

Check if LibreDWG version is 0.10 or earlier by running 'dwgread --version' or checking library version.

Check Version:

dwgread --version

Verify Fix Applied:

Update to the latest version and test with known malicious DWG samples from the GitHub issue to ensure no crash.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes or segmentation faults when processing DWG files
  • Unusual memory usage spikes in LibreDWG processes

Network Indicators:

  • Inbound transfers of DWG files to vulnerable services

SIEM Query:

Process: 'dwgread' OR 'libredwg' AND Event: 'Crash' OR 'Segmentation fault'

🔗 References

📤 Share & Export