Heap-based Buffer Overflow Vulnerability in vim Package

vim Updated 02 Oct 2025

Summary

19/12/2021
N/A
Yes i
High
7.8

UBUNTU-CVE-2021-4136: vim is vulnerable to Heap-based Buffer Overflow. Affects vim versions < 2:8.2.3995-1ubuntu2. Fixed in 2:8.2.3995-1ubuntu2. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The vim package is a highly configurable text editor used for efficient text editing and programming. It is widely utilized across various operating systems, including Ubuntu. The package offers features such as syntax highlighting, multi-level undo, and a powerful search functionality. However, it has been identified to have a critical vulnerability that could lead to severe security risks if not addressed promptly.

Vulnerability Detail

The vulnerability identified as CVE-2021-4136 in the vim package is a heap-based buffer overflow. This issue arises from improper handling of memory allocation, which can allow an attacker to execute arbitrary code or crash the application. The ramifications of this vulnerability are significant, as it can lead to unauthorized access to sensitive data, system instability, or even complete system compromise. The vulnerability has a CVSS score of 7.8, indicating a high level of risk.

How To Fix

Minimum fixed version

2:8.2.3995-1ubuntu2

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 features of vim that may trigger the vulnerability until the package is updated. It is advisable to refrain from opening untrusted files with vim until the patch is applied.

Conclusion

The heap-based buffer overflow vulnerability in the vim package poses a significant security risk. It is crucial for users to update to the patched version to protect their systems from potential exploits. Awareness and prompt action are key to maintaining system security.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2021-4136 is a heap-based buffer overflow vulnerability found in the vim package that can lead to arbitrary code execution.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The risks include unauthorized access to sensitive information, potential system crashes, and the possibility of complete system compromise.

Yes, the patched version of the vim package is 2:8.2.3995-1ubuntu2. Users should update to this version to mitigate the risk.

If you cannot update immediately, avoid using vim to open untrusted files and consider using alternative text editors until the update is applied.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

2:8.2.3995-1ubuntu2

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