CVE-2018-14939 in LibreOfficeinfo

Summary

by MITRE

The 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 FreeBSD libc, which might allow attackers to cause a denial of service (buffer overflow and application crash) or possibly have unspecified other impact if LibreOffice is automatically launched during web browsing with pathnames controlled by a remote web site.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 03/13/2020

The vulnerability identified as CVE-2018-14939 resides within the LibreOffice desktop application suite, specifically in the desktop/unx/source/start.c file where the get_app_path function demonstrates improper handling of the realpath system call. This flaw manifests particularly on systems utilizing FreeBSD libc implementations where the realpath function behavior deviates from standard POSIX expectations. The issue represents a classic buffer overflow vulnerability that can be exploited through improper memory management during path resolution operations, creating potential for both denial of service conditions and arbitrary code execution risks.

The technical implementation of this vulnerability stems from inadequate boundary checking and memory allocation handling within the get_app_path function. When LibreOffice processes file paths during automatic launch scenarios, particularly when triggered through web browsing contexts where remote websites can control pathname inputs, the realpath function fails to properly validate input lengths against allocated buffer sizes. This mismatch creates a scenario where attacker-controlled input can exceed buffer boundaries, leading to memory corruption that manifests as application crashes or unpredictable behavior. The vulnerability specifically impacts versions through 6.0.5, indicating a persistent flaw in the path resolution logic that was not adequately addressed in the codebase.

Operating environments where this vulnerability becomes exploitable include web browsers that automatically launch LibreOffice applications when opening certain file types, particularly those with maliciously crafted file paths or URLs. The attack vector requires a remote web site to provide pathnames that, when processed by LibreOffice, trigger the flawed realpath handling. This creates a potential for remote code execution or denial of service conditions that could be leveraged by attackers to disrupt user workflows or potentially gain unauthorized access to systems. The impact extends beyond simple application crashes to potentially allow for more sophisticated exploitation techniques that could compromise system integrity.

Mitigation strategies for CVE-2018-14939 should prioritize immediate patching of affected LibreOffice installations to version 6.1.0 or later where the vulnerability has been resolved through proper buffer size validation and memory management. System administrators should implement strict file type handling policies that prevent automatic execution of potentially malicious documents, particularly when browsing untrusted websites. Network-level protections including web application firewalls and content filtering systems can help prevent exploitation by blocking malicious URLs that might trigger the vulnerable code path. Additionally, users should be educated about the risks of automatically opening documents from untrusted sources, and organizations should consider implementing sandboxing mechanisms to contain potential exploitation attempts. The vulnerability aligns with CWE-121 and CWE-122 categories related to stack-based and heap-based buffer overflows, and could potentially map to ATT&CK techniques involving privilege escalation and execution through compromised applications.

Reservation

08/05/2018

Disclosure

08/05/2018

Moderation

accepted

CPE

ready

EPSS

0.00506

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!