Cloudanix VulnDB

CVE-2022-2580

High · 7.8

CVSS

7.8

EPSS

0.5%

Published

Aug 1, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in the popular text editor Vim could let attackers run harmful code on a computer simply by tricking someone into opening a specially made file.

Exploit Available
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 in Vim allows out-of-bounds memory writes when processing specially crafted input, potentially leading to arbitrary code execution with the privileges of the Vim process.

Why it matters to the business

Attackers could execute malicious code on developer or administrator systems that open untrusted files with the vulnerable editor, risking data theft, system compromise, or lateral movement in environments where Vim is used for configuration or log review.

How an attack unfolds

An attacker creates a malicious file designed to trigger the heap overflow in Vim's input handling routines. When a victim opens the file with a vulnerable Vim version, the overflow occurs during parsing, allowing the attacker to overwrite memory structures and redirect execution to attacker-controlled code.

How to fix it

Upgrade Vim to a version containing commit a6f9e300161f4cb54713da22f65b261595e8e614 or later. Rebuild from source or install updated packages from the distribution or GitHub releases. Disable unnecessary Vim features or use alternative editors for untrusted files until patched.

How to confirm the fix worked

Verify the installed Vim version reports 9.0.0102 or newer. Test by attempting to open known trigger files in a controlled environment and confirm no crash or unexpected behavior occurs. Review build logs or package metadata to confirm the patched commit is present.

Typical attack path

  1. Craft a malicious file that triggers the heap buffer overflow in Vim's parser
  2. Deliver the file to the target via email, download, or shared storage
  3. Convince the victim to open the file using Vim (often via command line or file association)
  4. Exploit the overflow to achieve code execution within the Vim process
  5. Escalate privileges or pivot to other systems from the compromised host

How to detect it

Monitor for unexpected Vim process crashes or segmentation faults when opening files. Review shell history and file access logs for unusual file opens involving Vim. Check system logs for memory corruption indicators around Vim execution times.

What your security team should do

  • Prioritize patching all Vim installations to the fixed commit a6f9e300161f4cb54713da22f65b261595e8e614
  • Scan developer workstations and servers for vulnerable Vim binaries and enforce version checks in CI/CD pipelines
  • Educate users on risks of opening untrusted files with Vim and consider sandboxing or alternative tools for high-risk workflows

The record

Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0102.

Affected packages

Ecosystem Package Introduced Fixed
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