# CVE-2026-6040: The Document Foundation LibreOffice use-after-free in ODF import

Source: https://junglewise.ai/threats/cve-2026-6040-the-document-foundation-libreoffice-use-after-free-in-odf-import  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-15. Updated: 2026-06-15  
License: CC BY 4.0 with a link back

CVE-2026-6040 · Severity: info · CVSS 5.4 · Published 2026-06-15

LibreOffice is a popular open-source office productivity suite used for creating and editing documents. A security vulnerability was found in how it handles specific number formatting in OpenDocument Format (ODF) files. If a user opens a specially crafted document, it could cause the application to crash or potentially allow an attacker to execute unauthorized code, impacting the reliability and security of the user's system.

Technologies: [The Document Foundation LibreOffice](https://junglewise.ai/threats/technologies/libreoffice). Vendors: [The Document Foundation](https://junglewise.ai/threats/vendors/the-document-foundation).

## Quick answers

**Is CVE-2026-6040 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-6040 being exploited in the wild.

**How severe is CVE-2026-6040?** Informational severity, with a CVSS score of 5.4, published 15 June 2026.

**Which products and versions are affected?** The Document Foundation LibreOffice.

**Is there a fix for CVE-2026-6040?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-6040 attacked?** It is attacked with local access, in a network appliance.

**Am I affected by CVE-2026-6040?** Check whether you run The Document Foundation LibreOffice. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A heap use-after-free vulnerability (CWE-416) and out-of-bounds write (CWE-787) exist in LibreOffice's ODF import component. The flaw is triggered when processing the blank-width characters of an ODF number format. A position value read from the document is not validated against the length of the format-code string, allowing the application to process memory outside the intended buffer. An attacker can exploit this by providing a malformed document that requires user interaction (opening the file). This can result in a crash (denial of service) or potentially arbitrary code execution in the context of the user. Fixed versions implement proper bounds-checking for the position value.

## Affected products

- The Document Foundation LibreOffice

## Timeline

- 2026-06-15: disclosed
- 2026-06-15: advisory

## References

- [https://www.libreoffice.org/about-us/security/advisories/cve-2026-6040](https://www.libreoffice.org/about-us/security/advisories/cve-2026-6040)

## Related threats

- [LibreOffice information disclosure via HLS playlist in GStreamer](https://junglewise.ai/threats/cve-2026-63269-libreoffice-can-link-to-audio-and-video-files-from-a-document-and)
- [LibreOffice environment variable and INI file expansion in URLs](https://junglewise.ai/threats/cve-2026-63278-urls-could-be-constructed-which-expanded-environment-variable-or)
- [LibreOffice stack buffer overflow in PPT colour-replacement import](https://junglewise.ai/threats/cve-2026-8356-libreoffice-stack-buffer-overflow-in-ppt-colour-replacement-import)
- [LibreOffice heap buffer overflow in OOXML import](https://junglewise.ai/threats/cve-2026-6047-libreoffice-heap-buffer-overflow-in-ooxml-import)
- [The Document Foundation LibreOffice heap buffer overflow in EMF+ import](https://junglewise.ai/threats/cve-2026-6045-the-document-foundation-libreoffice-heap-buffer-overflow-in-emf)
