Bug 1790055 (CVE-2019-5063)

Summary: CVE-2019-5063 opencv: Heap buffer overflow in persistence_xml.cpp while parsing crafted XML file
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: andrew, databases-maint, hhorak, jkucera, jmlich83, jridky, karlthered, kwizart, pkajaba, rakesh.pandit, sergio, viktor.vix.jancik
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: opencv 4.2.0 Doc Type: If docs needed, set a value
Doc Text:
A heap buffer overflow vulnerability was found in the data structure persistence functionality of OpenCV. Specifically, a specially crafted XML file could cause a buffer overflow, resulting in multiple heap corruptions and potential code execution. A remote attacker could exploit this flaw by providing a specially crafted XML file to trigger this vulnerability.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-20 16:31:48 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: 1790056    
Bug Blocks: 1790061    

Description Pedro Sampaio 2020-01-11 15:03:17 UTC
An exploitable heap buffer overflow vulnerability exists in the data structure
persistence functionality of OpenCV 4.1.0. A specially crafted XML file can
cause a buffer overflow, resulting in multiple heap corruptions and potential
code execution. An attacker can provide a specially crafted file to trigger this
vulnerability.

References:

https://talosintelligence.com/vulnerability_reports/TALOS-2019-0852

Comment 1 Pedro Sampaio 2020-01-11 15:03:37 UTC
Created opencv tracking bugs for this issue:

Affects: fedora-all [bug 1790056]

Comment 2 Mauro Matteo Cascella 2020-04-20 10:13:07 UTC
External References:

https://talosintelligence.com/vulnerability_reports/TALOS-2019-0852

Comment 3 Mauro Matteo Cascella 2020-04-20 13:08:20 UTC
Mitigation:

Avoid loading OpenCV data structures from external untrusted XML files.

Comment 5 Mauro Matteo Cascella 2020-04-20 13:23:46 UTC
Statement:

This flaw did not affect the versions of OpenCV as shipped with Red Hat Enterprise Linux 6, 7, and 8, as they did not include the vulnerable code, which was introduced in a later version of the library.

Comment 6 Mauro Matteo Cascella 2020-04-20 13:55:06 UTC
Upstream fix:
https://github.com/opencv/opencv/commit/f42d5399aac80d371b17d689851406669c9b9111

Comment 8 Product Security DevOps Team 2020-04-20 16:31:48 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-5063