Bug 2073013 (CVE-2022-1154)

Summary: CVE-2022-1154 vim: use after free in utf_ptr2char
Product: [Other] Security Response Reporter: Marian Rehak <mrehak>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: fhrdina, gchamoul, karsten, michal.skrivanek, mperina, sbonazzo, zdohnal
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: vim 8.2.4646 Doc Type: If docs needed, set a value
Doc Text:
A heap use-after-free vulnerability was found in Vim's utf_ptr2char() function of the src/mbyte.c file. This flaw occurs because vim is using a buffer line after it has been freed in the old regexp engine. This flaw allows an attacker to trick a user into opening a specially crafted file, triggering a heap use-after-free that causes an application to crash, possibly executing code and corrupting memory.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-01 09:26:09 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: 2073014, 2073389, 2073390, 2073391, 2073392, 2073393, 2073394    
Bug Blocks: 2073017    

Description Marian Rehak 2022-04-07 13:17:04 UTC
Use after free in utf_ptr2char capable of crashing software, Bypass Protection Mechanism, Modify Memory, and possible remote execution.

Reference:

https://huntr.dev/bounties/7f0ec6bc-ea0e-45b0-8128-caac72d23425
https://github.com/vim/vim/commit/b55986c52d4cd88a22d0b0b0e8a79547ba13e1d5

Comment 1 Marian Rehak 2022-04-07 13:17:19 UTC
Created vim tracking bugs for this issue:

Affects: fedora-all [bug 2073014]

Comment 5 Todd Cullum 2022-04-22 23:46:21 UTC
Note that this is not a "remote execution" situation; the only way to trigger this is by opening a file with Vim. Yes, potentially Vim could be set up to automatically open untrusted files submitted to it, but under typical use-cases, this would not be considered a remote code execution vulnerability in the same manner of say a server that receives a network packet and can suddenly be taken over by an attacker via the Internet.

Comment 6 errata-xmlrpc 2022-04-26 21:50:15 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:1552 https://access.redhat.com/errata/RHSA-2022:1552

Comment 8 errata-xmlrpc 2022-06-28 14:58:20 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2022:5242 https://access.redhat.com/errata/RHSA-2022:5242

Comment 9 Product Security DevOps Team 2022-07-01 09:26:06 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-2022-1154