Critical Use After Free Vulnerability in Vim Package

vim Updated 02 Oct 2025

Summary

30/03/2022
N/A
Yes i
High
7.8

UBUNTU-CVE-2022-1154: Use after free in utf_ptr2char in GitHub repository vim/vim prior to 8.2.4646. Affects vim versions < 2:7.4.052-1ubuntu3.1+esm5. Fixed in 2:7.4.052-1ubuntu3.1+esm5. 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 package is available across various Linux distributions, including Ubuntu. This vulnerability affects multiple versions of Vim, particularly those prior to 8.2.4646, exposing users to potential security risks.

Vulnerability Detail

The vulnerability, identified as CVE-2022-1154, is a use after free issue in the utf_ptr2char function within the Vim codebase. This flaw can be exploited by an attacker to execute arbitrary code, potentially leading to system compromise. The vulnerability arises from improper memory management, allowing an attacker to manipulate memory after it has been freed, which can result in unexpected behavior or crashes.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm5

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 in Vim or disable certain features that may trigger the vulnerability until the package is updated. However, the best course of action is to apply the patch as soon as it is available.

Conclusion

The CVE-2022-1154 vulnerability in Vim poses a significant risk to users, allowing for potential arbitrary code execution due to improper memory management. It is crucial for users to update their Vim installations to the latest patched versions to safeguard against this vulnerability.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2022-1154 is a critical vulnerability in the Vim text editor that allows for use after free, potentially leading to arbitrary code execution.

You can check your Vim version by running 'vim --version' in the terminal. If it is below 2:8.2.4646, it is vulnerable.

If immediate updates are not possible, avoid opening untrusted files in Vim and consider disabling features that may expose the vulnerability.

More information can be found in the Ubuntu Security Notices and the official Vim GitHub repository.

Vulert monitors open-source vulnerabilities in your software by analyzing the manifest file like package-lock.json, providing real-time alerts without requiring code access.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm5

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