CVE-2022-2889
High · 7.8CVSS
7.8
EPSS
0.5%
Published
Aug 19, 2022
CISA due date
—
Cloudanix analysis
A bug in the Vim text editor can let someone take over your computer if you open a specially made file with it.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Use-after-free in Vim's internal buffer handling allows memory corruption that can be leveraged for arbitrary code execution when processing specially crafted input.
Why it matters to the business
Developers or operators who open untrusted files in Vim risk full compromise of their workstation, potentially exposing source code, credentials, and downstream build or deployment systems.
How an attack unfolds
An attacker crafts a file that triggers the use-after-free condition during parsing or editing operations; the victim opens the file in an affected Vim binary, and the resulting memory corruption is turned into code execution.
How to fix it
Upgrade vim/vim to commit 91c7cbfe31bbef57d5fcf7d76989fc159f73ef15 or later (Vim 9.0.0225 or newer). Rebuild any locally compiled installations from the fixed source.
How to confirm the fix worked
Run 'vim --version' and confirm the build includes commit 91c7cbfe31bbef57d5fcf7d76989fc159f73ef15 or a later patch level; test with known trigger files in a sandbox to verify the crash no longer occurs.
Typical attack path
- Attacker prepares a malicious file designed to trigger the use-after-free
- Attacker delivers the file via email, repository, or shared storage
- Victim opens the file using an affected Vim binary
- Vim performs the operation that re-uses the freed memory
- Attacker-controlled data leads to arbitrary code execution
How to detect it
Review system and process logs for unexpected Vim crashes or child-process spawns immediately after file-open events; correlate with file-access timestamps on untrusted inputs.
What your security team should do
- Prioritize patching all developer workstations and CI systems that invoke Vim
- Block or sandbox execution of unpatched Vim binaries on high-value systems
- Add Vim version checks to configuration-management and vulnerability-scanning pipelines
- Educate users to avoid opening untrusted files with Vim until patches are applied
The record
Use After Free in GitHub repository vim/vim prior to 9.0.0225.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | vim | 0 | No fix |
| Debian:12 | vim | 0 | 2:9.0.0229-1 |
| Debian:13 | vim | 0 | 2:9.0.0229-1 |
| Mageia:8 | golang | 0 | 1.18.7-1.mga8 |
| Mageia:8 | vim | 0 | 9.0.828-1.mga8 |
| SUSE:Enterprise Storage 6 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Enterprise Storage 7 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Micro 5.1 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Micro 5.2 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP3 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP4 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP4 | vim | 0 | 9.0.0313-150000.5.25.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 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Server 15 SP2-BCL | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Server 15-LTSS | vim | 0 | 9.0.0313-150000.5.25.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 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Manager Proxy 4.1 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Manager Retail Branch Server 4.1 | vim | 0 | 9.0.0313-150000.5.25.1 |
| SUSE:Manager Server 4.1 | vim | 0 | 9.0.0313-150000.5.25.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:20.04:LTS | vim | 0 | 2:8.1.2269-1ubuntu5.17 |
| Ubuntu:22.04:LTS | vim | 0 | 2:8.2.3995-1ubuntu2.11 |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm12 |
| Ubuntu:Pro:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.13+esm4 |
| openSUSE:Leap 15.3 | vim | 0 | 9.0.0313-150000.5.25.1 |
| openSUSE:Leap 15.4 | vim | 0 | 9.0.0313-150000.5.25.1 |
| openSUSE:Leap Micro 5.2 | vim | 0 | 9.0.0313-150000.5.25.1 |
| openSUSE:Tumbleweed | vim | 0 | 9.0.0453-2.1 |
Related vulnerabilities
- CVE-2025-29768 Vim, a text editor, is vulnerable to potential data loss with zip.vim and special crafted… Also affects vim
- CVE-2025-27423 Vim is an open source, command line text editor. Also affects vim
- CVE-2025-24014 Vim is an open source, command line text editor. Also affects vim
- CVE-2025-22134 When switching to other buffers using the :all command and visual mode still being… Also affects vim
- CVE-2024-47814 Vim is an open source, command line text editor. Also affects vim
- CVE-2024-43802 Vim is an improved version of the unix vi text editor. Also affects vim
- CVE-2024-43374 The UNIX editor Vim prior to version 9.1.0678 has a use-after-free error in argument list… Also affects vim
- CVE-2024-22667 Vim before 9.0.2142 has a stack-based buffer overflow because did_set_langmap in map.c… Also affects vim