Bug 1947593 (CVE-2021-30184)

Summary: CVE-2021-30184 gnuchess: buffer overflows in the cmd_pgnload() and cmd_pgnreplay() functions in frontend/cmd.cc
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: caillon+fedoraproject, gwync, lgriffin, mcepl
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-04-08 23:35:31 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: 1947594, 1947595    
Bug Blocks: 1947596    

Description Guilherme de Almeida Suckevicz 2021-04-08 17:59:26 UTC
GNU Chess 6.2.7 allows attackers to execute arbitrary code via crafted PGN (Portable Game Notation) data. This is related to a buffer overflow in the use of a .tmp.epd temporary file in the cmd_pgnload and cmd_pgnreplay functions in frontend/cmd.cc.

References:
https://lists.gnu.org/archive/html/bug-gnu-chess/2021-04/msg00000.html
https://lists.gnu.org/archive/html/bug-gnu-chess/2021-04/msg00001.html

Comment 1 Guilherme de Almeida Suckevicz 2021-04-08 17:59:45 UTC
Created gnuchess tracking bugs for this issue:

Affects: epel-7 [bug 1947595]
Affects: fedora-all [bug 1947594]

Comment 2 Tomas Hoger 2021-04-08 19:25:40 UTC
The affected code appeared in multiple functions - cmd_load(), cmd_pgnload(), and cmd_pgnreplay().  It seems it was first introduced in gnuchess version 6.0 - the latest version 5.08 tagged in upstream CVS repo does not have them yet, and they are included in the initial import to the upstream SVN repo.

The cmd_load() was previously fixed via:

http://svn.savannah.gnu.org/viewvc/chess?view=revision&revision=182

The other two cases are not yet fixed upstream.

Comment 3 Product Security DevOps Team 2021-04-08 23:35:31 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-2021-30184