Skip to main content
CVE Vulnerability Database

CVE-2026-6039: LibreOffice Buffer Overflow Vulnerability

CVE-2026-6039 is a heap buffer overflow in LibreOffice's DXF import feature that occurs when processing polylines with excessive point counts. This article covers the technical details, affected versions, and mitigation.

Published:

CVE-2026-6039 Overview

CVE-2026-6039 is a heap buffer overflow in LibreOffice's DXF (Drawing Exchange Format) import filter. LibreOffice supports DXF files used by computer-aided design (CAD) software. The flaw resides in the polyline import routine, where the point count read from the file is truncated to a 16-bit value when sizing the destination buffer. The unmodified full count is then used to populate the buffer, allowing a polyline whose point count exceeds the 16-bit range to be written past the end of the allocated memory. Opening a crafted DXF file triggers the overflow on the heap, leading to memory corruption in the LibreOffice process.

Critical Impact

A crafted DXF file opened in a vulnerable LibreOffice version triggers a heap buffer overflow during polyline import, corrupting heap memory and impacting application availability.

Affected Products

  • LibreOffice (versions prior to the fix that rejects oversized DXF polylines)
  • The DXF import filter component used to load CAD drawings
  • Workstations that process DXF files originating from untrusted sources

Discovery Timeline

  • 2026-06-15 - CVE-2026-6039 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2026-6039

Vulnerability Analysis

The vulnerability is a numeric truncation error [CWE-197] that produces a heap buffer overflow during DXF import. The DXF format describes drawings as a sequence of entities, including polylines composed of multiple vertex points. When LibreOffice parses a polyline, it reads the declared point count from the file and uses it to allocate a buffer to hold the points.

The allocation path narrows the parsed count to a 16-bit integer before computing the buffer size. The subsequent population loop uses the original, untruncated count to write vertex data into that undersized buffer. When the file declares a count greater than 65,535, the buffer holds only the low 16 bits worth of entries while the loop writes the full number of points, overflowing the heap allocation.

The fixed versions reject DXF polylines whose declared point count exceeds the supported range, preventing the size mismatch between allocation and population.

Root Cause

The root cause is a width mismatch between the integer used to size the destination buffer and the integer used to drive the write loop. The implicit narrowing conversion to 16 bits during sizing breaks the invariant that allocated capacity must match the number of elements written.

Attack Vector

Exploitation requires local user interaction. An attacker delivers a crafted DXF file through email, file sharing, or a download, and the victim opens it in LibreOffice. No network access or elevated privileges are required on the target host. The resulting heap corruption primarily affects process availability and can influence adjacent heap metadata depending on allocator state.

No verified public proof-of-concept code is referenced in the advisory. See the LibreOffice Security Advisory CVE-2026-6039 for technical details.

Detection Methods for CVE-2026-6039

Indicators of Compromise

  • DXF files containing polyline entities with declared point counts greater than 65,535, which legitimate CAD tooling rarely produces.
  • Unexpected soffice or soffice.bin process crashes immediately after a user opens a DXF attachment.
  • Heap corruption signatures or stack traces in operating system crash logs that reference the LibreOffice DXF import filter.

Detection Strategies

  • Inspect DXF files at email and web gateways for polyline records whose vertex count fields exceed the 16-bit range.
  • Correlate file open telemetry with subsequent LibreOffice process termination events to surface likely exploitation attempts.
  • Hunt for DXF files arriving from untrusted external senders in environments where CAD interchange is not an expected business workflow.

Monitoring Recommendations

  • Forward LibreOffice crash and Windows Error Reporting (WER) events, macOS crash reports, or Linux core dumps to a central logging platform.
  • Alert on repeated soffice crashes across multiple endpoints within a short time window, which can indicate a campaign.
  • Track installed LibreOffice versions across the fleet to identify hosts still running pre-fix builds.

How to Mitigate CVE-2026-6039

Immediate Actions Required

  • Upgrade LibreOffice to the fixed release identified in the vendor advisory on all desktops and shared workstations.
  • Restrict opening DXF files received from untrusted email senders or external file shares until patching is complete.
  • Communicate the risk to users who routinely handle CAD files so they validate file origin before opening.

Patch Information

The LibreOffice project has released fixed versions that reject DXF polylines exceeding the supported point count, eliminating the size mismatch. Apply the update referenced in the LibreOffice Security Advisory CVE-2026-6039 through your standard software distribution channel.

Workarounds

  • Disable or remove the DXF import filter for users who do not require CAD interoperability.
  • Block DXF attachments at the email gateway for user populations that have no business need to receive them.
  • Open untrusted DXF files only inside an isolated virtual machine or sandbox until patches are deployed.
bash
# Verify the installed LibreOffice version on Linux endpoints
libreoffice --version

# Example: deploy the fixed package via apt on Debian/Ubuntu
sudo apt update && sudo apt install --only-upgrade libreoffice

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.