CVE-2022-0351
High · 7.8CVSS
7.8
EPSS
0.6%
Published
Jan 25, 2022
CISA due date
—
Cloudanix analysis
A bug in the vim text editor lets someone who can trick a user into opening a specially made file take control of that computer.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Out-of-bounds memory read before the start of a buffer in the vim text editor that can lead to local arbitrary code execution or process crash when processing crafted input.
Why it matters to the business
Local attackers can execute code on developer or administrator workstations that use vim, potentially leading to workstation compromise, data theft, or lateral movement with elevated urgency for organizations where vim is a core editing tool.
How an attack unfolds
An attacker prepares a specially crafted file or command-line input that triggers the buffer underflow when opened or processed by an affected vim binary; the resulting memory corruption is leveraged to gain code execution in the context of the user running vim.
How to fix it
Upgrade vim/vim to the commit 98056533b96b6b5d8849641de93185dd7bcadc44 or later; rebuild and redeploy any locally compiled installations; verify the updated binary reports the fixed version string.
How to confirm the fix worked
Run the updated vim binary against the original proof-of-concept input and confirm it no longer crashes or exhibits the underflow; compare build hash against the referenced commit; scan package repositories for the fixed release tag.
Typical attack path
- Craft malicious file or input designed to trigger buffer underflow in vim
- Deliver the file to the target via email, download, or shared storage
- Convince the victim to open the file using the vulnerable vim binary
- Exploit the memory corruption to execute attacker-controlled code locally
How to detect it
Review shell history, process creation logs, and file-access telemetry for unexpected vim invocations on crafted files; look for vim processes that terminate abnormally or spawn unusual child processes shortly after opening documents.
What your security team should do
- Immediately upgrade all vim installations to the commit 98056533b96b6b5d8849641de93185dd7bcadc44 or newer
- Block execution of known vulnerable vim binaries via endpoint policy until patched
- Monitor EPSS and exploit-availability feeds for any rise in observed in-the-wild use
The record
Access of Memory Location Before Start of Buffer in GitHub repository vim/vim prior to 8.2.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | vim | 0 | 2:8.1.0875-5+deb10u3 |
| Debian:11 | vim | 0 | No fix |
| Debian:11 | vim | 0 | 2:8.2.2434-3+deb11u2 |
| Debian:12 | vim | 0 | 2:8.2.4659-1 |
| Debian:13 | vim | 0 | 2:8.2.4659-1 |
| Debian:9 | vim | 0 | 2:8.0.0197-4+deb9u6 |
| Mageia:8 | vim | 0 | 8.2.4975-1.mga8 |
| SUSE:Enterprise Storage 6 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Enterprise Storage 6 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Enterprise Storage 7 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Enterprise Storage 7 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Micro 5.0 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Micro 5.1 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Micro 5.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Micro 5.2 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Micro 5.2 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP3 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP3 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP4 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP4 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Real Time 15 SP2 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server 12 SP2-BCL | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 12 SP3-BCL | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 12 SP4-LTSS | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 12 SP5 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 15 SP1-BCL | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server 15 SP1-BCL | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15 SP2-BCL | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server 15 SP2-BCL | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15-LTSS | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server 15-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Manager Proxy 4.1 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Manager Proxy 4.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Manager Retail Branch Server 4.1 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Manager Retail Branch Server 4.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Manager Server 4.1 | vim | 0 | 8.0.1568-5.17.1 |
| SUSE:Manager Server 4.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:OpenStack Cloud 9 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:OpenStack Cloud Crowbar 9 | vim | 0 | 9.0.0814-17.9.1 |
| Ubuntu:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.13 |
| Ubuntu:20.04:LTS | vim | 0 | 2:8.1.2269-1ubuntu5.14 |
| Ubuntu:22.04:LTS | vim | 0 | 2:8.2.3995-1ubuntu2.7 |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm9 |
| Ubuntu:Pro:16.04:LTS | vim | 0 | 2:7.4.1689-3ubuntu1.5+esm5 |
| openSUSE:Leap 15.3 | vim | 0 | 8.2.5038-150000.5.21.1 |
| openSUSE:Leap 15.3 | vim | 0 | 8.0.1568-5.17.1 |
| openSUSE:Leap 15.4 | vim | 0 | 8.2.5038-150000.5.21.1 |
| openSUSE:Tumbleweed | vim | 0 | 9.0.0453-2.1 |
Related vulnerabilities
- CVE-2023-4781 Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.1873. Also affects vim
- CVE-2023-4752 Use After Free in GitHub repository vim/vim prior to 9.0.1858. Also affects vim
- CVE-2023-2610 Integer Overflow or Wraparound in GitHub repository vim/vim prior to 9.0.1532. Also affects vim
- CVE-2022-3324 Stack-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0598. Also affects vim
- CVE-2022-2598 Out-of-bounds Write to API in GitHub repository vim/vim prior to 9.0.0100. Also affects vim
- CVE-2022-1720 Buffer Over-read in function grab_file_name in GitHub repository vim/vim prior to… Also affects vim
- CVE-2022-2000 Out-of-bounds Write in GitHub repository vim/vim prior to 8.2. Also affects vim
- CVE-2022-1968 Use After Free in GitHub repository vim/vim prior to 8.2. Also affects vim