Bug 1769907 (CVE-2019-9854)

Summary: CVE-2019-9854 libreoffice: Unsafe URL assembly flaw in allowed script location check
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: caolanm, dtardon, erack, sbergman
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libreoffice 6.2.7, libreoffice 6.3.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 22:35:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1743958, 1743962, 1769909, 1770069, 1770070    
Bug Blocks: 1769910    

Description Guilherme de Almeida Suckevicz 2019-11-07 16:55:32 UTC
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-2019-9852, to avoid a directory traversal attack where scripts in arbitrary locations on the file system could be executed by employing a URL encoding attack to defeat the path verification step. However this protection could be bypassed by taking advantage of a flaw in how LibreOffice assembled the final script URL location directly from components of the passed in path as opposed to solely from the sanitized output of the path verification step. This issue affects: Document Foundation LibreOffice 6.2 versions prior to 6.2.7; 6.3 versions prior to 6.3.1.

References:
https://www.libreoffice.org/about-us/security/advisories/CVE-2019-9854/
https://seclists.org/bugtraq/2019/Sep/17

Comment 1 Guilherme de Almeida Suckevicz 2019-11-07 16:55:43 UTC
Created libreoffice tracking bugs for this issue:

Affects: fedora-all [bug 1769909]

Comment 2 Huzaifa S. Sidhpurwala 2019-11-08 03:50:35 UTC
External References:

https://www.libreoffice.org/about-us/security/advisories/CVE-2019-9854/

Comment 4 Huzaifa S. Sidhpurwala 2019-11-08 04:11:20 UTC
An attacker is able to trigger execution of arbitrary python scripts, previously placed at certain locations in the file system, when libreoffice documents are opened and certain actions are performed. However there are several conditions to successful exploitation:

1. The document needs to have macros associated with certain actions like opening the document, mouse over etc. This can be achieved by sending malicious files to users via email etc and social engineering them to open the document.
2. The malicious script needs to exists on the file system to be executed.

Comment 5 errata-xmlrpc 2020-03-31 19:28:34 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:1151 https://access.redhat.com/errata/RHSA-2020:1151

Comment 6 Product Security DevOps Team 2020-03-31 22:35:52 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-9854

Comment 7 errata-xmlrpc 2020-04-28 15:28:40 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2020:1598 https://access.redhat.com/errata/RHSA-2020:1598