Critical Use After Free Vulnerability in Vim Package

vim Updated 02 Oct 2025

Summary

10/06/2022
N/A
Yes i
High
7.8

UBUNTU-CVE-2022-2042: Use After Free in GitHub repository vim/vim prior to 8.2. Affects vim versions < 2:7.4.052-1ubuntu3.1+esm15. Fixed in 2:7.4.052-1ubuntu3.1+esm15. 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 used for efficiently creating and editing any kind of text. It is known for its powerful features, including syntax highlighting, multi-level undo, and extensive plugin support. However, it has been found to be vulnerable to a Use After Free issue, which can lead to severe security risks if exploited.

Vulnerability Detail

The vulnerability identified as CVE-2022-2042 is a Use After Free flaw in the Vim package, which allows an attacker to potentially execute arbitrary code. This vulnerability arises from improper handling of memory, leading to a situation where the program continues to use memory that has already been freed. If exploited, this could allow attackers to gain unauthorized access to sensitive information or control over the affected system.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm15

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 using specific features of Vim that may trigger the vulnerability until the package is updated. However, it is highly recommended to apply the patch as soon as possible.

Conclusion

The Use After Free vulnerability in the Vim package poses significant security risks. Users are strongly advised to update their Vim installations to the latest patched versions to protect against potential exploitation. Utilizing tools like Vulert can further enhance security by monitoring for vulnerabilities in real-time.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2022-2042 is a Use After Free vulnerability in the Vim text editor that can lead to arbitrary code execution.

You can check if your Vim installation is affected by using the Vulert playground at Vulert Scanner, which allows you to monitor for vulnerabilities without requiring installation.

Exploitation of this vulnerability could allow attackers to execute arbitrary code, potentially leading to unauthorized access and control over the affected system.

Yes, patched versions of Vim are available. Users should update to one of the specified patched versions to mitigate the risk.

Vulert is a service that monitors and alerts for open-source vulnerabilities in software using a manifest file. It helps developers ensure their applications are secure without needing to access the code directly.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm15

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