Vulnerability record · CVE-2018-16858 · published 25 March 2019
CVE-2018-16858: LibreOffice directory traversal enables macro code execution
Libreoffice · Libreoffice
LibreOffice before 6.0.7 and 6.1.3 is vulnerable to a directory traversal flaw that lets a crafted document execute arbitrary macros bundled with it. An attacker can make LibreOffice run a Python method from a script at any file system location relative to the install path, turning a simple document open into code execution.
Description
It was found that libreoffice before versions 6.0.7 and 6.1.3 was vulnerable to a directory traversal attack which could be used to execute arbitrary macros bundled with a document. An attacker could craft a document, which when opened by LibreOffice, would execute a Python method from a script in any arbitrary file system location, specified relative to the LibreOffice install location.
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Automated analysis
critical priorityCVSS 9.8, public exploit code and very high EPSS make this a high-risk code execution flaw despite no KEV listing.
What it is
LibreOffice before 6.0.7 and 6.1.3 is vulnerable to a directory traversal flaw that lets a crafted document execute arbitrary macros bundled with it. An attacker can make LibreOffice run a Python method from a script at any file system location relative to the install path, turning a simple document open into code execution.
Impact
An attacker gains arbitrary code execution in the context of the user who opens the document, with high impact to confidentiality, integrity and availability. This can lead to full system compromise of the victim's account.
Attack surface
The flaw is reached by opening a malicious document in LibreOffice; no authentication is required and the CVSS vector indicates no user interaction beyond opening the file. The attack is network-deliverable as a file.
Exploitation
Public exploit code exists (ExploitDB, Packet Storm, Rapid7 module) and EPSS is 0.673 with a 99.3 percentile, indicating high likelihood of exploitation; it is not listed in CISA KEV.
What to do
- Upgrade LibreOffice to 6.0.7, 6.1.3 or later, or apply the vendor or distribution patches (e.g. Red Hat RHSA-2019:2130).
- Disable or restrict macro execution from untrusted documents via LibreOffice security settings and policy.
- Block or quarantine untrusted office documents at email and web gateways, and warn users against opening unexpected attachments.
- Run LibreOffice with least privilege and consider sandboxing or application control to limit macro execution impact.
Detection
- Monitor for LibreOffice processes spawning unusual child processes such as python, sh, cmd or powershell.
- Alert on file writes or reads by LibreOffice in unexpected paths outside user document directories.
- Search endpoint logs for document opens followed by script interpreter execution or network connections from LibreOffice.
- Use file reputation and sandbox detonation for office documents containing macros or embedded scripts.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2018-16858 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2018-16858), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.