CVE-2022-33027

7.8 HIGH

📋 TL;DR

LibreDWG v0.12.4.4608 contains a heap-use-after-free vulnerability in the dwg_add_handleref function that could allow attackers to execute arbitrary code or cause denial of service. This affects applications using LibreDWG to process DWG files, including CAD software and file converters. Users who open malicious DWG files are at risk.

💻 Affected Systems

Products:
  • LibreDWG
Versions: v0.12.4.4608 specifically, potentially earlier versions with same code
Operating Systems: All platforms running LibreDWG
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using LibreDWG library to parse DWG files is vulnerable

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise if exploited via malicious DWG file processing

🟠

Likely Case

Application crash or denial of service when processing specially crafted DWG files

🟢

If Mitigated

Limited impact if file processing occurs in sandboxed environment with proper memory protections

🌐 Internet-Facing: MEDIUM - Requires user interaction to open malicious files, but web applications processing uploaded DWG files could be vulnerable
🏢 Internal Only: MEDIUM - Internal users could be targeted via email attachments or shared files

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting malicious DWG file; heap manipulation required for code execution

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v0.12.5 or later

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

Restart Required: Yes

Instructions:

1. Update LibreDWG to v0.12.5 or later
2. Rebuild any applications using LibreDWG library
3. Restart affected services

🔧 Temporary Workarounds

Disable DWG file processing

all

Temporarily disable LibreDWG-based DWG file processing until patched

Use alternative DWG libraries

all

Switch to alternative DWG processing libraries like Teigha or Open Design Alliance

🧯 If You Can't Patch

  • Implement strict file upload validation for DWG files
  • Run LibreDWG processes in sandboxed containers with limited privileges

🔍 How to Verify

Check if Vulnerable:

Check LibreDWG version: redwg --version or examine library version in applications

Check Version:

redwg --version

Verify Fix Applied:

Confirm version is v0.12.5 or later and test with known problematic DWG files

📡 Detection & Monitoring

Log Indicators:

  • Application crashes when processing DWG files
  • Memory access violation errors in logs

Network Indicators:

  • Unusual DWG file uploads to web applications
  • Multiple failed file processing attempts

SIEM Query:

source="application.log" AND ("segmentation fault" OR "heap corruption" OR "access violation") AND "dwg"

🔗 References

📤 Share & Export