Bug 1984646 (CVE-2021-36976)

Summary: CVE-2021-36976 libarchive: use-after-free in copy_string()
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: bdettelb, caswilli, databases-maint, dmoppert, fjansen, kaycoth, ljavorsk, mike, ndevos, panovotn, pkubat, praiskup, psegedy, tomckay, vmugicag
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A use-after-free flaw was found in libarchive in the copy_string function.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 13:15:11 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: 1984647, 1984648, 1985190    
Bug Blocks: 1984649    

Description Guilherme de Almeida Suckevicz 2021-07-21 20:10:55 UTC
libarchive 3.4.1 through 3.5.1 has a use-after-free in copy_string (called from do_uncompress_block and process_block).

Reference:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32375

Comment 1 Guilherme de Almeida Suckevicz 2021-07-21 20:11:47 UTC
Created libarchive tracking bugs for this issue:

Affects: fedora-all [bug 1984647]


Created mingw-libarchive tracking bugs for this issue:

Affects: fedora-all [bug 1984648]

Comment 2 Doran Moppert 2021-07-22 06:07:39 UTC
This appears to not have been reported upstream.  

Attaching a patch that adds the test against the first upstream affected commit (47bb8187).  Running that test with asan results in UAF .. but the UAF region was allocated by the previous test, so it looks like something not initialized properly when reading the reproducer.

Comment 18 Product Security DevOps Team 2022-05-17 13:15:08 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-36976