CVE-2018-16858
published 2019-03-25CVE-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 arbitrary macros…
PriorityP178critical9.8CVSS 3.0
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
67.55%
99.2th percentile
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.
Affected
27 ranges· showing 25
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| canonical | ubuntu_linux | — | — |
| canonical | ubuntu_linux | — | — |
| canonical | ubuntu_linux | — | — |
| debian | debian_linux | — | — |
| debian | debian_linux | — | — |
| debian | debian_linux | — | — |
| debian | libreoffice | < libreoffice 1:6.1.3-1 (bookworm) | libreoffice 1:6.1.3-1 (bookworm) |
| debian | libreoffice | < libreoffice 1:6.3.0-1 (bookworm) | libreoffice 1:6.3.0-1 (bookworm) |
| document_foundation | libreoffice | >= 6.2 < 6.2.7 | 6.2.7 |
| document_foundation | libreoffice | >= 6.3 < 6.3.1 | 6.3.1 |
| document_foundation | libreoffice | >= unspecified < 6.2.6 | 6.2.6 |
| fedoraproject | fedora | — | — |
| libreoffice | libreoffice | < 6.2.6 | 6.2.6 |
| libreoffice | libreoffice | < 6.0.7 | 6.0.7 |
| libreoffice | libreoffice | >= 0 < 1:6.3.0-1 | 1:6.3.0-1 |
| libreoffice | libreoffice | >= 0 < 1:6.1.3-1 | 1:6.1.3-1 |
| libreoffice | libreoffice | >= 0 < 1:6.3.0-1 | 1:6.3.0-1 |
| libreoffice | libreoffice | >= 0 < 1:6.1.3-1 | 1:6.1.3-1 |
| libreoffice | libreoffice | >= 0 < 1:6.3.0-1 | 1:6.3.0-1 |
| libreoffice | libreoffice | >= 0 < 1:6.1.3-1 | 1:6.1.3-1 |
| libreoffice | libreoffice | >= 0 < 1:6.3.0-1 | 1:6.3.0-1 |
| libreoffice | libreoffice | >= 0 < 1:6.1.3-1 | 1:6.1.3-1 |
| libreoffice | libreoffice | >= 0 < 1:4.2.8-0ubuntu5.5 | 1:4.2.8-0ubuntu5.5 |
| libreoffice | libreoffice | >= 0 < 1:5.1.6~rc2-0ubuntu1~xenial6 | 1:5.1.6~rc2-0ubuntu1~xenial6 |
| libreoffice | libreoffice | >= 6.1.0 < 6.1.3 | 6.1.3 |
Detection & IOCsextracted from sources · hover to see the quote
- →The exploit delivers a malicious ODT (OpenDocument Text) file containing a mouse-over event that triggers code execution without any warning dialogue — hunt for ODT files with embedded script/macro event bindings referencing Python scripts via directory traversal paths. ↗
- →The directory traversal payload targets pydoc.py's tempfilepager function to pass arguments to os.system. Detect macro event references containing '../' sequences pointing to pydoc.py inside ODT/ODF documents. ↗
- →Malicious URLs in ODT documents may be rendered invisible by setting text color to match the document background — inspect ODT XML for hyperlinks with matching foreground/background color attributes. ↗
- →CVE-2019-9852 is a URL-encoding bypass of the CVE-2018-16858 directory traversal fix — also detect percent-encoded traversal sequences (e.g., %2e%2e%2f) in LibreOffice macro script path references within documents. ↗
- ·The vulnerability is cross-platform (Linux, Windows, and macOS). The Metasploit module targets win/linux; macOS exploitation requires editing the PoC code. ↗
- ·The fix in 6.1.3.2 was later bypassed by CVE-2019-9852 via URL encoding; ensure patching extends to LibreOffice 6.2.6+ to address both vulnerabilities. ↗
CVSS provenance
nvdv3.09.8CRITICALCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv2.07.5HIGHAV:N/AC:L/Au:N/C:P/I:P/A:P
osv9.8CRITICAL
vendor_debian7.8HIGH
vendor_redhat7.8HIGH
vendor_ubuntu7.8HIGH
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
libreoffice: Insufficient URL encoding flaw in allowed script location check
vendor_redhat·2019-08-15·CVSS 7.8
CVE-2019-9852 [HIGH] CWE-22 libreoffice: Insufficient URL encoding flaw in allowed script location check
libreoffice: Insufficient URL encoding flaw in allowed script location check
LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-open etc. Access is intended to be restricted to scripts under the share/Scripts/python, user/Scripts/python sub-directories of the LibreOffice install. Protection was added, to address CVE-2018-16858, to avoid a directory traversal attack where scripts in arbitrary locations on the file system could be executed. However this new protection could be bypassed by a URL encoding attack. In the fixed versions, the parsed url describing the script location is correctly encoded before further processing. This issue affects: Document Foundation LibreOffice versions prior t
Ubuntu
LibreOffice vulnerabilities
vendor_ubuntu·2019-02-06·CVSS 7.8
CVE-2018-10119 [HIGH] LibreOffice vulnerabilities
Title: LibreOffice vulnerabilities
Summary: Several security issues were fixed in LibreOffice.
It was discovered that LibreOffice incorrectly handled certain document
files. If a user were tricked into opening a specially crafted document, a
remote attacker could cause LibreOffice to crash, and possibly execute
arbitrary code. (CVE-2018-10119, CVE-2018-10120, CVE-2018-11790)
It was discovered that LibreOffice incorrectly handled embedded SMB
connections in document files. If a user were tricked in to opening a
specially crafted document, a remote attacker could possibly exploit this
to obtain sensitive information. (CVE-2018-10583)
Alex Inführ discovered that LibreOffice incorrectly handled embedded
scripts in document files. If a user were tricked into opening a specially
crafted docu
Red Hat
libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning
vendor_redhat·2019-02-01·CVSS 7.8
CVE-2018-16858 [HIGH] CWE-356 libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning
libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning
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.
It was found that libreoffice 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 loc
Debian
CVE-2019-9852: libreoffice - LibreOffice has a feature where documents can specify that pre-installed macros ...
vendor_debian·2019·CVSS 7.8
CVE-2019-9852 [HIGH] CVE-2019-9852: libreoffice - LibreOffice has a feature where documents can specify that pre-installed macros ...
LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-open etc. Access is intended to be restricted to scripts under the share/Scripts/python, user/Scripts/python sub-directories of the LibreOffice install. Protection was added, to address CVE-2018-16858, to avoid a directory traversal attack where scripts in arbitrary locations on the file system could be executed. However this new protection could be bypassed by a URL encoding attack. In the fixed versions, the parsed url describing the script location is correctly encoded before further processing. This issue affects: Document Foundation LibreOffice versions prior to 6.2.6.
Scope: local
bookworm: resolved (fixed in 1:6.3.0-1)
bullseye: resolv
Debian
CVE-2018-16858: libreoffice - It was found that libreoffice before versions 6.0.7 and 6.1.3 was vulnerable to ...
vendor_debian·2018·CVSS 7.8
CVE-2018-16858 [HIGH] CVE-2018-16858: libreoffice - It was found that libreoffice before versions 6.0.7 and 6.1.3 was vulnerable to ...
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.
Scope: local
bookworm: resolved (fixed in 1:6.1.3-1)
bullseye: resolved (fixed in 1:6.1.3-1)
forky: resolved (fixed in 1:6.1.3-1)
sid: resolved (fixed in 1:6.1.3-1)
trixie: resolved (fixed in 1:6.1.3-1)
GHSA
GHSA-vgrf-j225-8963: LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-
ghsa_unreviewed·2022-05-24·CVSS 7.8
CVE-2019-9852 [HIGH] CWE-22 GHSA-vgrf-j225-8963: LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-
LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-open etc. Access is intended to be restricted to scripts under the share/Scripts/python, user/Scripts/python sub-directories of the LibreOffice install. Protection was added, to address CVE-2018-16858, to avoid a directory traversal attack where scripts in arbitrary locations on the file system could be executed. However this new protection could be bypassed by a URL encoding attack. In the fixed versions, the parsed url describing the script location is correctly encoded before further processing. This issue affects: Document Foundation LibreOffice versions prior to 6.2.6.
GHSA
GHSA-v39m-j232-p3qr: It was found that libreoffice before versions 6
ghsa_unreviewed·2022-05-14
CVE-2018-16858 [CRITICAL] CWE-22 GHSA-v39m-j232-p3qr: It was found that libreoffice before versions 6
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.
OSV
CVE-2019-9852: LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-
osv·2019-08-15·CVSS 9.8
CVE-2019-9852 [CRITICAL] CVE-2019-9852: LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-
LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-open etc. Access is intended to be restricted to scripts under the share/Scripts/python, user/Scripts/python sub-directories of the LibreOffice install. Protection was added, to address CVE-2018-16858, to avoid a directory traversal attack where scripts in arbitrary locations on the file system could be executed. However this new protection could be bypassed by a URL encoding attack. In the fixed versions, the parsed url describing the script location is correctly encoded before further processing. This issue affects: Document Foundation LibreOffice versions prior to 6.2.6.
OSV
CVE-2018-16858: It was found that libreoffice before versions 6
osv·2019-03-25·CVSS 9.8
CVE-2018-16858 [CRITICAL] CVE-2018-16858: It was found that libreoffice before versions 6
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.
OSV
libreoffice vulnerabilities
osv·2019-02-06·CVSS 7.8
CVE-2018-10119 [HIGH] libreoffice vulnerabilities
libreoffice vulnerabilities
It was discovered that LibreOffice incorrectly handled certain document
files. If a user were tricked into opening a specially crafted document, a
remote attacker could cause LibreOffice to crash, and possibly execute
arbitrary code. (CVE-2018-10119, CVE-2018-10120, CVE-2018-11790)
It was discovered that LibreOffice incorrectly handled embedded SMB
connections in document files. If a user were tricked in to opening a
specially crafted document, a remote attacker could possibly exploit this
to obtain sensitive information. (CVE-2018-10583)
Alex Inführ discovered that LibreOffice incorrectly handled embedded
scripts in document files. If a user were tricked into opening a specially
crafted document, a remote attacker could possibly execute arbitrary code.
(CVE-
Suricata
ET EXPLOIT LibreOffice pydoc RCE Inbound (CVE-2018-16858)
suricata·2021-07-27·CVSS 7.8
CVE-2018-16858 [HIGH] ET EXPLOIT LibreOffice pydoc RCE Inbound (CVE-2018-16858)
ET EXPLOIT LibreOffice pydoc RCE Inbound (CVE-2018-16858)
Rule: alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"ET EXPLOIT LibreOffice pydoc RCE Inbound (CVE-2018-16858)"; flow:established,to_client; file.data; content:"<office|3a|document"; depth:100; content:"<office|3a|"; distance:0; content:"<script|3a|"; content:"|2f|pydoc.py|24|tempfilepager"; distance:0; fast_pattern; reference:url,www.exploit-db.com/exploits/46727; reference:cve,2018-16858; classtype:attempted-admin; sid:2033456; rev:2; metadata:created_at 2021_07_27, cve CVE_2018_16858, confidence High, signature_severity Major, tag Description_Generated_By_Proofpoint_Nexus, updated_at 2024_03_08;)
Exploit-DB
LibreOffice < 6.2.6 Macro - Python Code Execution (Metasploit)
exploitdb·2019-08-21·CVSS 7.8
CVE-2019-9851 [HIGH] LibreOffice < 6.2.6 Macro - Python Code Execution (Metasploit)
LibreOffice 'LibreOffice Macro Python Code Execution',
'Description' => %q{
LibreOffice comes bundled with sample macros written in Python and
allows the ability to bind program events to them.
LibreLogo is a macro that allows a program event to execute text as Python code, allowing RCE.
This module generates an ODT file with a dom loaded event that,
when triggered, will execute arbitrary python code and the metasploit payload.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Nils Emmerich', # Vulnerability discovery and PoC
'Shelby Pace', # Base module author (CVE-2018-16858), module reviewer and platform-independent code
'LoadLow', # This msf module
'Gabriel Masei' # Global events vuln. disclosure
],
'References' =>
[
[ 'CVE', '2019-9851' ],
[ 'URL', 'https://www.libreoffice.org/about-us/se
Exploit-DB
LibreOffice < 6.0.7 / 6.1.3 - Macro Code Execution (Metasploit)
exploitdb·2019-04-18
CVE-2018-16858 LibreOffice < 6.0.7 / 6.1.3 - Macro Code Execution (Metasploit)
LibreOffice 'LibreOffice Macro Code Execution',
'Description' => %q{
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.
},
Metasploit
LibreOffice Macro Code Execution
metasploit
LibreOffice Macro Code Execution
LibreOffice Macro Code Execution
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.
Bugzilla
CVE-2019-9852 libreoffice: Insufficient URL encoding flaw in allowed script location check
bugzilla·2019-08-23·CVSS 7.8
CVE-2019-9852 [HIGH] CVE-2019-9852 libreoffice: Insufficient URL encoding flaw in allowed script location check
CVE-2019-9852 libreoffice: Insufficient URL encoding flaw in allowed script location check
A vulnerability was found in LibreOffice prior to 6.2.6. LibreOffice has a feature where documents can specify that pre-installed macros can be executed on various script events such as mouse-over, document-open etc. Access is intended to be restricted to scripts under the share/Scripts/python, user/Scripts/python sub-directories of the LibreOffice install. Protection was added, to address CVE-2018-16858, to avoid a directory traversal attack where scripts in arbitrary locations on the file system could be executed. However this new protection could be bypassed by a URL encoding attack. In the fixed versions, the parsed url describing the script location is correctly encoded before further processin
Bugzilla
CVE-2018-16858 libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning [fedora-all]
bugzilla·2019-02-03·CVSS 7.8
CVE-2018-16858 [HIGH] CVE-2018-16858 libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning [fedora-all]
CVE-2018-16858 libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of fedora-all.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit m
Bugzilla
CVE-2018-16858 libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning
bugzilla·2018-11-14·CVSS 7.8
CVE-2018-16858 [HIGH] CVE-2018-16858 libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning
CVE-2018-16858 libreoffice: Arbitrary python functions in arbitrary modules on the filesystem can be executed without warning
A flaw was found in libreoffice. If a document does not contain macros/scripts, but references a pre-installed macro/script execution of those macros/scripts, execution is allowed without warning bypassing normal behavior.
Discussion:
Acknowledgments:
Name: The LibreOffice project
Upstream: Alex Inführ
---
In versions of libreoffice shipped with Red Hat Enterprise Linux 6 and 7, arbitrary arguements cannot be passed to the scripts/macros, hence meaningful exploitation is difficult.
---
External References:
https://www.libreoffice.org/about-us/security/advisories/cve-2018-16858/
---
Created libreoffice tracking bugs for this issue:
Affects: fedora-all [bu
Tenable
LibreOffice Vulnerable to Code Execution in URL Mouseover Preview Feature
blogs_tenable·2019-02-01
LibreOffice Vulnerable to Code Execution in URL Mouseover Preview Feature
## Cloud Exposure
Tenable Cloud Security (CNAPP) Request a demo
Tenable Cloud Vulnerability Management Request a demo
Tenable CIEM Request a demo
Secure your cloud
## Vulnerability Exposure
Tenable Vulnerability Management Try for free
Tenable Security Center Request a demo
Tenable Web App Scanning Try for free
Tenable Patch Management Request a demo
Tenable Enclave Security Request a demo
Tenable Attack Surface Management Request a demo
Tenable Nessus Try for free
## AI Exposure
Tenable AI Exposure Request a demo
## OT/IoT Exposure
Tenable OT Security Request a demo
## Identity Exposure
Tenable Identity Exposure Request a demo
## Business needs
Active Directory
AI Security Posture Management (AI-SPM)
AWS security
Azure security
Cloud Security Posture Man
Tenable
LibreOffice Vulnerable to Code Execution in URL Mouseover Preview Feature
blogs_tenable·2019-02-01·CVSS 7.8
CVE-2018-16858 [HIGH] LibreOffice Vulnerable to Code Execution in URL Mouseover Preview Feature
Blog / Cyber Exposure Alerts
Subscribe
# LibreOffice Vulnerable to Code Execution in URL Mouseover Preview Feature
Ryan Seguin
February 1, 2019
2 Min Read
Researcher Alex Inführ discovered that LibreOffice 6.1.0-6.1.3.1 is susceptible to a code injection attack if a user hovers their mouse over a malicious URL.
### Background
Researcher Alex Inführ disclosed a LibreOffice vulnerability (CVE-2018-16858) in versions 6.1.0-6.1.3.1 which shows that code injection is possible on both Linux and Windows versions when a user hovers their mouse over a malicious URL.
Update: Tenable Research was able to confirm that this vulnerability is also exploitable on macOS by editing the Proof of Concept (PoC) code.
### Analysis
While this vulnerability does require user interaction, an OpenDocument
http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00059.htmlhttp://packetstormsecurity.com/files/152560/LibreOffice-Macro-Code-Execution.htmlhttp://www.rapid7.com/db/modules/exploit/multi/fileformat/libreoffice_macro_exechttps://access.redhat.com/errata/RHSA-2019:2130https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16858https://seclists.org/bugtraq/2019/Aug/28https://www.exploit-db.com/exploits/46727/https://www.libreoffice.org/about-us/security/advisories/cve-2018-16858/http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00059.htmlhttp://packetstormsecurity.com/files/152560/LibreOffice-Macro-Code-Execution.htmlhttp://www.rapid7.com/db/modules/exploit/multi/fileformat/libreoffice_macro_exechttps://access.redhat.com/errata/RHSA-2019:2130https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16858https://seclists.org/bugtraq/2019/Aug/28https://www.exploit-db.com/exploits/46727/https://www.libreoffice.org/about-us/security/advisories/cve-2018-16858/
2019-03-25
Published