Exploit database

Vulnerability

CVE-2018-16858

Vulnerability details

Score
7.8
Severity
high

CVSS 3.0 · redhat

Vector string

CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

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.

CVE Program

Exploit source choices

6 sources
LibreOffice Macro Code Execution
MSF-multi--fileformat--libreoffice_macro_execMetasploitLinux,Windows / remote

LibreOffice comes bundled with sample macros written in Python and allows the ability to bind program events to them. A macro can be tied to a program event by including the script that contains the macro and the function name to be executed. Additionally, a directory traversal vulnerability exists in the component that references the Python script to be executed. This allows a program event to execute functions from Python scripts relative to the path of the samples macros folder. The pydoc.py script included with LibreOffice contains the tempfilepager function that passes arguments to os.system, allowing RCE. This module generates an ODT file with a mouse over event that when triggered, will execute arbitrary code.

2018-10-18libreoffice_macro_exec.rb
4nimanegra/libreofficeexploit1
GH-650014268cb2fcce47e02b872b141c19GitHubUnofficial GitHub source

CVE-2018-16858 exploit implementation

2019-04-148 files · 3 stars
bantu2301/cve-2018-16858
GH-ad8e26a2bc7839bb7d80ceb41a82779eGitHubUnofficial GitHub source

bantu2301/cve-2018-16858 source repository

2022-11-093 files · 1 stars
phongld97/detect-cve-2018-16858
GH-b56f2ed52ed425b58c3802f36187116bGitHubUnofficial GitHub source

phongld97/detect-cve-2018-16858 source repository

2019-11-072 files · 1 stars