Heap-based Buffer Overflow Vulnerability in vim Package

vim Updated 02 Oct 2025

Summary

27/10/2021
N/A
Yes i
High
7.8

ALPINE-CVE-2021-3903: vim is vulnerable to Heap-based Buffer Overflow. Affects vim versions < 8.2.3567-r0. Fixed in 8.2.3567-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 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

The vim package is a widely used text editor that provides powerful editing capabilities for various programming languages and text files. Known for its efficiency and extensibility, vim is a staple tool among developers and system administrators. However, it has been identified to have a critical vulnerability that can lead to severe security implications if not addressed promptly.

Vulnerability Detail

The vulnerability identified as CVE-2021-3903 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 exploit the vulnerability by crafting specific input that exceeds the allocated buffer size. The ramifications of this vulnerability are significant, as it could lead to arbitrary code execution, data corruption, or system crashes. The CVSS score for this vulnerability is 7.8, indicating a high severity level that necessitates immediate attention.

How To Fix

Minimum fixed version

8.2.3567-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

As a temporary measure, users can avoid using features of vim that may trigger the vulnerability until the package is updated. Additionally, running vim in a restricted environment or using alternative text editors can help minimize exposure to potential exploits.

Conclusion

The heap-based buffer overflow vulnerability in the vim package (CVE-2021-3903) poses a significant risk to users. It is crucial to update to the patched version 8.2.3567-r0 to mitigate potential exploits. Users are encouraged to monitor their software for vulnerabilities using tools like Vulert.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2021-3903 is a vulnerability in the vim package that allows for a heap-based buffer overflow, potentially leading to arbitrary code execution.

You can check if your version of vim is affected by using the Vulert playground at Vulert Scanner, which allows you to monitor and alert for open-source vulnerabilities.

If an immediate update is not possible, consider using alternative text editors or restricting the use of vim features that may trigger the vulnerability.

Failing to address this vulnerability can lead to severe consequences, including unauthorized access, data loss, and system instability.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

8.2.3567-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