Bug 2029513 (CVE-2021-4069)

Summary: CVE-2021-4069 vim: use-after-free in ex_open() in src/ex_docmd.c
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: bdettelb, caswilli, fjansen, gchamoul, gparvin, jburrell, jwong, karsten, kaycoth, pahickey, psegedy, stcannon, vkumar, vmugicag, zdohnal
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: vim 8.2.3741 Doc Type: If docs needed, set a value
Doc Text:
A heap use-after-free flaw was found in Vim's ex_open() function in src/ex_docmd.c file. This flaw allows an attacker to trick the victim into opening a specially crafted file that triggers a use-after-free error, allowing the attacker to compromise the system and execute arbitrary code.
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 2029514, 2029776, 2029783    
Bug Blocks: 2029515    

Description Guilherme de Almeida Suckevicz 2021-12-06 16:51:02 UTC
Vim is vulnerable to use-after-free.

Reference:
https://huntr.dev/bounties/0efd6d23-2259-4081-9ff1-3ade26907d74

Upstream patch:
https://github.com/vim/vim/commit/e031fe90cf2e375ce861ff5e5e281e4ad229ebb9

Comment 1 Guilherme de Almeida Suckevicz 2021-12-06 16:51:17 UTC
Created vim tracking bugs for this issue:

Affects: fedora-all [bug 2029514]

Comment 2 lnacshon 2021-12-07 09:54:58 UTC
published PCO

Create a file with content 
)/\v/
o/\%')

execute vim -u NONE -X -Z -e -s -S file -c :qa!