Heap-based Buffer Overflow Vulnerability in vim Package

vim Updated 02 Oct 2025

Summary

15/10/2021
N/A
Yes i
Medium
5.5

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

The vim package is a highly configurable text editor used for efficient text editing and programming. It is widely utilized in various operating systems due to its powerful features and extensibility. However, it has been identified to have a critical vulnerability that could lead to severe security issues if not addressed promptly.

Vulnerability Detail

The vulnerability identified as CVE-2021-3875 is a heap-based buffer overflow in the vim package. This flaw arises from improper handling of memory allocation, which can be exploited by an attacker to execute arbitrary code or crash the application. The potential ramifications include unauthorized access to system resources and data corruption, making it crucial for users to address this vulnerability immediately.

How To Fix

Minimum fixed version

8.2.3500-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 workaround, users can avoid using 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 possible.

Conclusion

The heap-based buffer overflow vulnerability in the vim package (CVE-2021-3875) poses a significant risk to users. It is essential to update to the patched version 8.2.3500-r0 to mitigate potential threats. Users are encouraged to utilize tools like Vulert for ongoing monitoring of their software for vulnerabilities.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2021-3875 is a vulnerability in the vim package that allows for a heap-based buffer overflow, potentially leading 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.

Failing to fix this vulnerability could lead to unauthorized access, data corruption, and system crashes, posing significant security risks.

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

The CVSS score for this vulnerability is 5.5, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

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