CVE-2022-1160
vim: heap buffer overflow in get_one_sourceline
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · March 28, 2022
Updated · November 22, 2025
Description
A heap buffer overflow flaw was found in vim's get_one_sourceline() function of scriptfile.c file. This flaw occurs when "source" can read past the end of the copied line. This flaw allows an attacker to trick a user into opening a crafted file, triggering a heap-overflow and causing an application to crash, which leads to a denial of service.
Statement
Red Hat Enterprise Linux - 6, 7, 8, 9 are not affected, because vulnerable code is not present in binary RPMs of Vim shipped with RHEL.
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
Untrusted vim scripts with -s [scriptin] are not recommended to run.
CVSS / CWE
CVSS 3.1 · 7.8CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CWE-120 · Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')