CVE-2022-33032

7.8 HIGH

📋 TL;DR

LibreDWG v0.12.4.4608 contains a heap buffer overflow vulnerability in the decode_preR13_section_hdr function. This allows attackers to execute arbitrary code or cause denial of service by processing specially crafted DWG files. Anyone using LibreDWG to parse DWG files is affected.

💻 Affected Systems

Products:
  • LibreDWG
Versions: v0.12.4.4608 and earlier versions
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 LibreDWG processes malicious files from untrusted sources.

🟠

Likely Case

Application crash (denial of service) when processing malformed DWG files.

🟢

If Mitigated

Limited impact if file processing is restricted to trusted sources and proper sandboxing is implemented.

🌐 Internet-Facing: MEDIUM - Risk exists if LibreDWG processes files from external sources via web interfaces or APIs.
🏢 Internal Only: LOW - Risk is limited if only trusted internal DWG files are processed.

🎯 Exploit Status

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

Exploitation requires crafting a malicious DWG file and getting it processed by LibreDGW. No public exploit code is available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v0.12.4.4609 and later

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

Restart Required: Yes

Instructions:

1. Check current LibreDWG version. 2. Update to v0.12.4.4609 or later via package manager or source compilation. 3. Restart any services using LibreDWG.

🔧 Temporary Workarounds

Restrict file processing

all

Only allow LibreDWG to process DWG files from trusted sources

Sandbox LibreDWG processes

linux

Run LibreDWG in isolated containers or restricted environments

docker run --read-only --cap-drop=ALL -v /trusted/files:/input:ro libredwg

🧯 If You Can't Patch

  • Disable LibreDWG processing of untrusted DWG files
  • Implement strict input validation for DWG files before processing

🔍 How to Verify

Check if Vulnerable:

Check LibreDWG version: dwgread --version or check package manager

Check Version:

dwgread --version 2>&1 | grep -i version

Verify Fix Applied:

Verify version is v0.12.4.4609 or later and test with known problematic DWG files

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault or crash logs from LibreDWG processes
  • Unexpected process termination when processing DWG files

Network Indicators:

  • Unusual network connections after DWG file processing
  • Outbound connections from LibreDWG processes

SIEM Query:

process_name:"dwgread" AND (event_type:"crash" OR exit_code:139)

🔗 References

📤 Share & Export