CVE-2022-1968
High · 7.8CVSS
7.8
EPSS
1.4%
Published
Jun 2, 2022
CISA due date
—
Cloudanix analysis
A long-standing bug in the popular text editor Vim can let attackers take over a computer if someone opens a specially made file, and the fix has been available for years.
- 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 condition in Vim allows a specially crafted file or command to reference freed memory, enabling memory corruption that can lead to arbitrary code execution or denial of service when the vulnerable editor processes attacker-controlled input.
Why it matters to the business
Attackers can fully compromise developer or administrator workstations that open malicious files with vulnerable Vim versions, resulting in data theft, persistent access, or disruption of source-code editing and system-administration workflows; the issue has been public for over four years with public exploits available.
How an attack unfolds
An attacker crafts a malicious file or command sequence that triggers the use-after-free in Vim's internal data structures; when a user opens the file or executes the command in an affected Vim build, the freed memory is reused, allowing the attacker to corrupt memory and execute arbitrary code under the privileges of the Vim process.
How to fix it
Upgrade vim/vim to commit 98056533b96b6b5d8849641de93185dd7bcadc44 or later; rebuild from source or obtain a patched package that contains this fix. Where immediate patching is not possible, avoid opening untrusted files with Vim and consider using alternative editors for high-risk workflows.
How to confirm the fix worked
Confirm the installed Vim binary reports a version built from commit 98056533b96b6b5d8849641de93185dd7bcadc44 or newer; test by attempting to open known trigger files in a controlled environment and verify absence of crashes or unexpected behavior; re-scan systems after upgrades to ensure the vulnerable commit is no longer present.
Typical attack path
- Prepare malicious file or command that triggers the use-after-free in Vim's buffer or register handling
- Deliver the file via email, download, or shared repository to a target user
- User opens the file or runs the command in vulnerable Vim (local, no privileges required, user interaction needed)
- Memory corruption occurs leading to code execution or crash
- Attacker establishes foothold on the workstation
How to detect it
Review command-line history, shell logs, and editor invocation records for unusual Vim usage; monitor for crashes or segmentation faults in vim processes; examine recently opened files in viminfo or swap files for unexpected content; correlate with endpoint telemetry for post-exploitation activity following Vim execution.
What your security team should do
- Immediately upgrade all Vim installations to the fixed commit 98056533b96b6b5d8849641de93185dd7bcadc44
- Block or sandbox execution of unpatched Vim on high-value systems until remediation is complete
- Update vulnerability scanners and asset inventories to reflect the fixed commit as the minimum acceptable version
- Educate developers and administrators about the risk of opening untrusted files with Vim
The record
Use After Free 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: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 | 2:7.4.052-1ubuntu3.1+esm8 |
| Ubuntu:Pro:16.04:LTS | vim | 0 | 2:7.4.1689-3ubuntu1.5+esm10 |
| 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-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-1942 Heap-based Buffer Overflow in GitHub repository vim/vim prior to 8.2. Also affects vim