CVE Database›Document archive›CVE-2022-1942

CVE-2022-1942

vim: out of bounds write in vim_regsub_both()

Loading…

Severity

Moderate

Red Hat Product Security

6.6

CVSS 3.1

Review impact separately from score.

Published · May 31, 2022

Updated · November 21, 2025

Description

An out-of-bounds write vulnerability was found in Vim's vim_regsub_both() function in the src/regexp.c file. The flaw can open a command-line window from a substitute expression when a text or buffer is locked. This flaw allows an attacker to trick a user into opening a specially crafted file, triggering an out-of-bounds write that causes an application to crash, possibly reading and modifying some amount of memory contents.

Statement

The versions of Vim shipped with Red Hat Enterprise Linux are not affected, because there is no presence of vulnerable code in our code-base.

Red Hat Enterprise Virtualization 4 consumes RHEL-8 vim, and as RHEL-8 is not affected, Hence, RHEV is also not affected.

Red Hat Product Security has rated this issue as having a Moderate security impact. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

No mitigation is specified in collected source.

CVSS / CWE

CVSS 3.1 · 6.6
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H

CWE-787 · Out-of-bounds Write