Heap-based Buffer Overflow in Vim Package - CVE-2022-2125

vim Updated 02 Oct 2025

Summary

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

UBUNTU-CVE-2022-2125: Heap-based Buffer Overflow in GitHub repository vim/vim prior to 8.2. Affects vim versions < 2:7.4.052-1ubuntu3.1+esm8. Fixed in 2:7.4.052-1ubuntu3.1+esm8. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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, making it critical for users to ensure they are using a patched version to avoid potential exploits.

Vulnerability Detail

The vulnerability identified as CVE-2022-2125 is a heap-based buffer overflow found in the Vim text editor. This flaw allows an attacker to exploit the buffer overflow, potentially leading to arbitrary code execution. The vulnerability originates from improper handling of certain inputs, which can be manipulated to overflow the buffer, compromising the integrity of the application. The CVSS score for this vulnerability is 7.8, indicating a high severity level that necessitates immediate attention.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm8

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

If immediate updating is not feasible, consider restricting access to the Vim editor or using alternative text editors until the patch can be applied. Additionally, users can monitor their systems for any unusual activity that may indicate exploitation attempts.

Conclusion

The CVE-2022-2125 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. Regular monitoring and prompt updates are essential for maintaining software security.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2022-2125 is a vulnerability in the Vim text editor that allows for a heap-based buffer overflow, potentially leading to arbitrary code execution.

You can check your version of Vim by running 'vim --version' in the terminal. Compare it against the patched versions provided in the vulnerability details.

If you cannot update Vim, consider using alternative text editors or restricting access to Vim until a patch can be applied.

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

Vulert monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json, providing real-time insights without requiring code access.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm8

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