Heap-based buffer overflow in Vim - CVE-2022-0158
Published: February 22, 2022 / Updated: February 22, 2022
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
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
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
- https://huntr.dev/bounties/ac5d7005-07c6-4a0a-b251-ba9cdbf6738b
- https://github.com/vim/vim/commit/5f25c3855071bd7e26255c68bf458b1b5cf92f39
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HD5S2FC2HF22A7XQXK2XXIR46EARVWIM/
- http://www.openwall.com/lists/oss-security/2022/01/15/1
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3FH2J57GDA2WMBS6J56F6QQRA6BXQQFZ/
Related Security Bulletins
- Amazon Linux AMI update for vim
- Multiple vulnerabilities in Vim
- Multiple vulnerabilities in Apple macOS Monterey
- Multiple vulnerabilities in macOS Big Sur
- Gentoo update for Vim, gVim
- Ubuntu update for vim
- VMware Tanzu products update for Vim
- Amazon Linux AMI update for vim
- Fedora 35 update for vim
- Fedora 34 update for vim