Critical Use After Free Vulnerability in Vim Package

vim Updated 02 Oct 2025

Summary

02/12/2022
N/A
Yes i
High
7.8

UBUNTU-CVE-2022-3591: Use After Free in GitHub repository vim/vim prior to 9.0.0789. Affects vim versions < 2:7.4.052-1ubuntu3.1+esm13. Fixed in 2:7.4.052-1ubuntu3.1+esm13. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Vim is a highly configurable text editor built to enable efficient text editing. It is widely used by developers and system administrators for its powerful features and extensibility. The Vim package is available on various Linux distributions, including Ubuntu, and is known for its versatility in handling different file types and programming languages. However, recent vulnerabilities have raised concerns about its security, particularly a critical use-after-free vulnerability that could allow attackers to execute arbitrary code.

Vulnerability Detail

The vulnerability, identified as CVE-2022-3591, originates from a use-after-free condition in the Vim codebase prior to version 9.0.0789. This flaw can be exploited by an attacker to manipulate memory, potentially leading to arbitrary code execution. The ramifications of this vulnerability are severe, as it could allow unauthorized access to sensitive data or system control. The CVSS score for this vulnerability is 7.8, indicating a high severity level.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm13

This is the first release that contains the fix.

sudo apt-get install --only-upgrade vim

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid opening untrusted files or disabling certain Vim features that may trigger the vulnerability. However, the best course of action is to apply the patch as soon as possible.

Conclusion

The CVE-2022-3591 vulnerability in the Vim package poses a significant risk due to its potential for arbitrary code execution. Users are strongly advised to update their Vim installations to the latest patched versions to mitigate this risk. Additionally, temporary workarounds can be employed until the update is applied.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2022-3591 is a critical use-after-free vulnerability found in the Vim text editor that can lead to arbitrary code execution.

You can check your Vim version using the command 'vim --version' in the terminal. Compare it with the patched versions listed in the 'how_to_fix' section.

If an immediate update is not possible, refrain from opening untrusted files in Vim and consider disabling features that may exploit this vulnerability.

Detailed information can be found in the Ubuntu security notices and the official CVE database.

Vulert allows users to monitor and alert in real-time for open-source vulnerabilities using just a manifest file like package-lock.json, without needing access to the code or installation.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm13

This is the first release that contains the fix.

sudo apt-get install --only-upgrade vim

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback