Heap-based Buffer Overflow Vulnerability in vim

vim Updated 02 Oct 2025

Summary

10/01/2022
N/A
Yes i
Low
3.3

CVE-2022-0158: vim is vulnerable to Heap-based Buffer Overflow. Affects vim versions < 8.2.4173-r0. Fixed in 8.2.4173-r0. 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 Penetration testing for web, API and mobile 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 popular text editor that is widely used for editing files in various programming languages. It provides a wide range of features and customization options, making it a preferred choice for many developers. However, a vulnerability has been discovered in vim that allows for a heap-based buffer overflow.

Vulnerability Detail

The vulnerability in vim arises due to improper handling of certain input data. An attacker can exploit this vulnerability by crafting a specially crafted input that triggers a buffer overflow in the heap. This can lead to arbitrary code execution or a denial of service condition. The impact of this vulnerability can be severe, as it allows an attacker to gain unauthorized access to the system or cause the application to crash.

How To Fix

Minimum fixed version

8.2.4173-r0

This is the first release that contains the fix.

sudo apk add --upgrade vim

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

Workaround

If updating vim is not immediately feasible, users can apply a workaround to mitigate the risk. One possible workaround is to disable certain features or plugins in vim that are known to be vulnerable. This can be done by modifying the configuration files or removing the vulnerable components. However, it is important to note that this workaround may limit the functionality of vim and should be considered temporary until the update can be applied.

Conclusion

The heap-based buffer overflow vulnerability in vim poses a significant risk to systems and applications using this text editor. It is crucial to update vim to the latest version or apply the recommended workaround to mitigate the risk. Regularly monitoring for vulnerabilities using tools like Vulert can help ensure the security of your software.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

The vulnerability allows an attacker to execute arbitrary code or cause a denial of service condition. This can lead to unauthorized access to the system or application crashes.

You can use the Vulert Playground at Vulert Scanner to check if your vim installation is affected by this vulnerability. Simply upload your package-lock.json file and it will analyze the dependencies for any known vulnerabilities.

Yes, a patch is available in vim version 8.2.4173-r0 or later. It is recommended to update your vim installation to the latest version to fix the vulnerability.

Yes, you can disable certain features or plugins in vim that are known to be vulnerable. This can help mitigate the risk until you can update to the latest version.

For further support on vulnerability remediation, you can contact info@devnack.com. They can provide guidance and assistance in addressing the vulnerability in your vim installation.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

8.2.4173-r0

This is the first release that contains the fix.

sudo apk add --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