← Vulnerability feed

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.

9.8 CVSS 3.0 Critical EPSS 67% · top 0.7% CWE-356 · CWE-356CWE-22 · Path traversal
9.8CVSS 3.0 base score, v2 7.5
67%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
16References, 4 tagged exploit
17 Jun 2026Last modified by NVD

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

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 19 September 2026. Confidence: high.

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.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2024-5261Libreoffice improper certificate validation vulnerabilityImproper Certificate Validation vulnerability in LibreOffice "LibreOfficeKit" mode disables TLS certification verification LibreOfficeKit can be used…EPSS 0.43%10.0CVE-2014-0247Fedoraproject fedora vulnerabilityLibreOffice 4.2.4 executes unspecified VBA macros automatically, which has unspecified impact and attack vectors, possibly related to doc/docmacromod…EPSS 3.9%9.8CVE-2019-9855Libreoffice vulnerabilityLibreOffice is typically bundled with LibreLogo, a programmable turtle vector graphics script, which can execute arbitrary python commands contained …EPSS 2.6%9.8CVE-2019-9850Canonical ubuntu linux improper input validation vulnerabilityLibreOffice is typically bundled with LibreLogo, a programmable turtle vector graphics script, which can execute arbitrary python commands contained …EPSS 3.4%9.8CVE-2019-9851LibreOffice LibreLogo global script event validation bypass allows Python executionLibreOffice bundles LibreLogo, a programmable turtle graphics script that can execute arbitrary Python commands embedded in a document. A prior fix f…EPSS 78%analysed9.8CVE-2019-9848Libreoffice code injection vulnerabilityLibreOffice has a feature where documents can specify that pre-installed scripts can be executed on various document events such as mouse-over, etc. …EPSS 31%9.8CVE-2018-14939Libreoffice memory buffer overflow vulnerabilityThe get_app_path function in desktop/unx/source/start.c in LibreOffice through 6.0.5 mishandles the realpath function in certain environments such as…EPSS 2.2%9.8CVE-2018-6871Libreoffice vulnerabilityLibreOffice before 5.4.5 and 6.x before 6.0.1 allows remote attackers to read arbitrary files via =WEBSERVICE calls in a document, which use the COM.…EPSS 23%

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.