Bug 1896120 (CVE-2017-18926)

Summary: CVE-2017-18926 raptor: heap-based buffer overflows due to an error in calculating the maximum nspace declarations for the XML writer
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, fweimer, green, jgrulich, jskarvad, kde-sig, rdieter
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 20:37:06 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: 1896534    
Bug Blocks: 1896121    

Description Guilherme de Almeida Suckevicz 2020-11-09 19:00:46 UTC
raptor_xml_writer_start_element_common in raptor_xml_writer.c in Raptor RDF Syntax Library 2.0.15 miscalculates the maximum nspace declarations for the XML writer, leading to heap-based buffer overflows (sometimes seen in raptor_qname_format_as_xml).

Reference:
https://www.openwall.com/lists/oss-security/2017/06/07/1

Upstream patch:
https://github.com/LibreOffice/core/blob/master/external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1

Comment 3 Todd Cullum 2020-11-10 20:14:21 UTC
Flaw summary:

When raptor2 processes a crafted input file, it could execute a heap-buffer-overflow -> out-of-bounds write due to improper calculation of `nspace_max_count` in raptor_xml_writer.c. In the context of RHEL-8, this library is used by libreoffice to parse files. If it were affected, an attacker who could social engineer a victim into opening a crafted file could trigger this flaw and impact application availability or in more rare circumstances, data integrity. However, libreoffice shipped with RHEL-8 has already been patched and thus libreoffice is notaffected.

Comment 4 Todd Cullum 2020-11-10 20:26:02 UTC
Upstream patch in raptor (aforementioned patch is in LibreOffice): https://github.com/dajobe/raptor/commit/590681e546cd9aa18d57dc2ea1858cb734a3863f

Comment 5 Todd Cullum 2020-11-10 20:29:25 UTC
Statement:

LibreOffice as shipped with Red Hat Enterprise Linux 8 is notaffected by this flaw as the version of raptor used in LibreOffice already has the patch.

Comment 9 errata-xmlrpc 2021-05-18 15:30:44 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:1842 https://access.redhat.com/errata/RHSA-2021:1842

Comment 10 Product Security DevOps Team 2021-05-18 20:37:06 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-2017-18926