Bug 1691717 (CVE-2019-9904)

Summary: CVE-2019-9904 graphviz: recursive function call in agclose in lib\cgraph\graph.c causing stack consumption
Product: [Other] Security Response Reporter: Dhananjay Arunesh <darunesh>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: alex, jima, jskarvad, tremble
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-10-27 03:26:50 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: 1691719, 1693323, 1693324    
Bug Blocks: 1691718    

Description Dhananjay Arunesh 2019-03-22 10:23:13 UTC
An issue was discovered in lib\cdt\dttree.c in libcdt.a in graphviz 2.40.1. Stack consumption occurs because of recursive agclose calls in lib\cgraph\graph.c in libcgraph.a, related to agfstsubg in lib\cgraph\subg.c.

Reference:
https://gitlab.com/graphviz/graphviz/issues/1512
https://research.loginsoft.com/vulnerability/stack-buffer-overflow-in-function-agclose-graphviz/

Comment 1 Dhananjay Arunesh 2019-03-22 10:25:38 UTC
Created graphviz tracking bugs for this issue:

Affects: fedora-all [bug 1691719]

Comment 2 Jaroslav Škarvada 2019-03-22 11:40:10 UTC
I doubt it has security implications. From what I have seen it's about overflowing the stack by "over 24,000 nested graphs" processing which is quite a lot for graphviz. IMHO this can happen with every recursive processor if there is no artificial barrier for the recursion. Also IMHO DoS for graphviz is not much an issue - there are many reproducers which can crash it and they never got CVE. Also it's not clear to me how it is related to the pdftops the researchers are talking about in their report. Just my two cents.

Comment 3 Marco Benatto 2019-03-27 12:42:44 UTC
Statement:

This issue affects the versions of graphviz as shipped with Red Hat Enterprise Linux 6 and 7.

Red Hat Enterprise Linux 6 is now in Maintenance Support 2 Phase of the support and maintenance life cycle. This has been
rated as having a security impact of Low, and is not currently planned to be addressed in future updates. For additional
information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.