CVE-2022-1720
High · 7.8CVSS
7.8
EPSS
2.2%
Published
Jun 20, 2022
CISA due date
—
Cloudanix analysis
A bug in the Vim text editor can let attackers crash the program or take control of a computer when someone opens a specially made file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Buffer over-read in grab_file_name allows out-of-bounds memory access leading to crash, memory corruption, or potential code execution when processing crafted input.
Why it matters to the business
Users running vulnerable Vim versions risk editor crashes, data corruption, or remote code execution when opening attacker-supplied files, potentially disrupting development workflows and requiring urgent patching across developer systems.
How an attack unfolds
An attacker crafts a file with malformed content that triggers the over-read when Vim calls grab_file_name during file handling; the victim opens the file in an affected Vim version, resulting in memory corruption that may be leveraged for code execution.
How to fix it
Upgrade vim/vim to commit 395bd1f6d3edc9f7edb5d1f2d7deaf5a9e3ab93c or later equivalent release; rebuild and redeploy all affected installations.
How to confirm the fix worked
Confirm Vim version reports 8.2.4956 or newer; test with known trigger files to verify absence of crash or corruption; review build logs for the fixed commit.
Typical attack path
- Attacker creates malicious file designed to trigger buffer over-read in grab_file_name
- Victim opens the file using vulnerable Vim (prior to 8.2.4956)
- Vim processes the file name extraction, causing out-of-bounds read and memory corruption
- Attacker leverages corruption for crash, data leak, or remote code execution
How to detect it
Review application logs and crash reports for Vim segmentation faults or memory errors during file open operations; monitor for unexpected process behavior when handling files from untrusted sources.
What your security team should do
- Immediately update all Vim installations to the fixed commit or patched release
- Scan developer environments and CI systems for vulnerable Vim binaries
- Block or sanitize untrusted files before opening in Vim until patches are applied
The record
Buffer Over-read in function grab_file_name in GitHub repository vim/vim prior to 8.2.4956. This vulnerability is capable of crashing the software, memory modification, and possible remote execution.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | vim | 0 | 2:8.1.0875-5+deb10u3 |
| Debian:11 | vim | 0 | No fix |
| Debian:12 | vim | 0 | 2:9.0.0135-1 |
| Debian:13 | vim | 0 | 2:9.0.0135-1 |
| Debian:9 | vim | 0 | 2:8.0.0197-4+deb9u7 |
| 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:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.12 |
| Ubuntu:20.04:LTS | vim | 0 | 2:8.1.2269-1ubuntu5.13 |
| Ubuntu:22.04:LTS | vim | 0 | 2:8.2.3995-1ubuntu2.5 |
| Ubuntu:Pro:14.04:LTS | vim | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm8 |
| Ubuntu:Pro:16.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.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-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
- CVE-2022-1942 Heap-based Buffer Overflow in GitHub repository vim/vim prior to 8.2. Also affects vim