CVE-2022-2522
High · 7.8CVSS
7.8
EPSS
0.6%
Published
Jul 25, 2022
CISA due date
—
Cloudanix analysis
A flaw in the Vim text editor lets attackers who trick someone into opening a bad file take over or crash the program on that computer.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow triggered by specially crafted input that exceeds expected buffer sizes during parsing or editing operations in Vim.
Why it matters to the business
Attackers with local access can crash the editor or execute arbitrary code, disrupting developer productivity and potentially compromising developer workstations or build systems if malicious files are opened.
How an attack unfolds
An attacker creates a malicious file containing oversized or malformed data that triggers the overflow when Vim opens or processes it; the attacker then convinces a user to open the file in an affected Vim version, leading to memory corruption that can be leveraged for code execution.
How to fix it
Upgrade Vim to version 9.0.0061 or later by applying commit 5fa9f23a63651a8abdb074b4fc2ec9b1adc6b089; rebuild from source or obtain updated packages from distribution maintainers; avoid opening untrusted files until patched.
How to confirm the fix worked
Verify the installed Vim version reports 9.0.0061 or newer; test with known proof-of-concept inputs if available in a controlled environment; confirm the vulnerable commit is absent from the build.
Typical attack path
- Craft malicious input file designed to overflow heap buffers in Vim's input handling routines
- Deliver the file via email, download link, or shared repository to a target user
- Trick the user into opening the file with an affected Vim binary
- Exploit the resulting memory corruption to execute attacker-controlled code or crash the process
How to detect it
Review system and application logs for unexpected Vim process crashes or segmentation faults when opening files; inspect command history and recently opened files for unusual patterns; correlate with file creation or download events preceding editor instability.
What your security team should do
- Prioritize patching all developer and CI systems running Vim within the next sprint due to public exploit availability
- Implement application allow-listing or sandboxing for text editors where feasible
- Educate users on risks of opening files from untrusted sources
- Monitor for new EPSS increases or exploit refinements
The record
Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0061.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | vim | 0 | No fix |
| Debian:12 | vim | 0 | 2:9.0.0135-1 |
| Debian:13 | vim | 0 | 2:9.0.0135-1 |
| 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 | No fix |
| 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 | No fix |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm12 |
| Ubuntu:Pro:16.04:LTS | vim | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | vim | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.13+esm4 |
| Ubuntu:Pro:20.04:LTS | vim | 0 | No fix |
| 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.0032-1.2 |
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