Heap-based buffer overflow in Vim - CVE-2022-0158

 

Heap-based buffer overflow in Vim - CVE-2022-0158

Published: February 22, 2022 / Updated: February 22, 2022


Vulnerability identifier: #VU60767
CSH Severity: High
CVSS v4: 8.4 [CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2022-0158
CWE-ID: CWE-122
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to a boundary error when processing lines that start with the "$" character. A remote attacker can trick the victim to open a specially crafted file, trigger heap-based buffer overflow and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.


Affected software

Vim
Amazon Linux AMI
Gentoo Linux
macOS
Ubuntu
Fedora
VMware Tanzu Application Service for VMs
Isolation Segment
VMware Tanzu Operations Manager
vim-athena (Ubuntu package)
xxd (Ubuntu package)
vim (Ubuntu package)
vim-tiny (Ubuntu package)
vim-gtk3 (Ubuntu package)
vim-nox (Ubuntu package)
vim
app-editors/gvim
app-editors/vim
app-editors/vim-core

How to mitigate CVE-2022-0158

Install updates from vendor's website.

Vim - update to 8.2.4049
macOS - addressed in versions 11.6.8 20G730, 12.3 21E230
VMware Tanzu Operations Manager - update to 3.0.14
vim-athena (Ubuntu package) - update to 2:8.2.3995-1ubuntu2.9
xxd (Ubuntu package) - update to 2:8.2.3995-1ubuntu2.9
vim (Ubuntu package) - update to 2:8.2.3995-1ubuntu2.9
vim-tiny (Ubuntu package) - update to 2:8.2.3995-1ubuntu2.9
vim-gtk3 (Ubuntu package) - update to 2:8.2.3995-1ubuntu2.9
vim-nox (Ubuntu package) - update to 2:8.2.3995-1ubuntu2.9
vim - addressed in versions 8.2.4068-1.fc34, 8.2.4068-1.fc35
app-editors/gvim - update to 9.0.0060
app-editors/vim - update to 9.0.0060
app-editors/vim-core - update to 9.0.0060
vim - update to 9.0.1160-1.1

External References

Related Security Bulletins