Heap-based Buffer Overflow in Vim Package - CVE-2023-4781

vim Updated 02 Oct 2025

Summary

05/09/2023
N/A
Yes i
High
7.8

ALPINE-CVE-2023-4781: Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.1873. Affects vim versions < 9.0.2073-r0. Fixed in 9.0.2073-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 highly configurable text editor used for efficiently creating and changing any kind of text. It is known for its powerful features, including syntax highlighting, multi-level undo, and extensive plugin support. However, it has been found vulnerable to a heap-based buffer overflow, which can lead to severe security issues.

Vulnerability Detail

The vulnerability identified as CVE-2023-4781 is a heap-based buffer overflow in the Vim package, specifically in versions prior to 9.0.1873. This flaw can be exploited by attackers to execute arbitrary code, potentially leading to data corruption, unauthorized access, or system crashes. The vulnerability arises from improper handling of memory allocation, making it a critical issue that needs immediate attention.

How To Fix

Minimum fixed version

9.0.2073-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 immediate patching is not possible, consider disabling any features or plugins that may trigger the vulnerability until an update can be applied. Additionally, running Vim in a restricted environment can help limit potential damage.

Conclusion

The CVE-2023-4781 vulnerability in the Vim package poses serious security risks due to a heap-based buffer overflow. It is crucial to update to the patched versions to safeguard your systems. Regular monitoring and using tools like Vulert can help maintain security against such vulnerabilities.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2023-4781 is a heap-based buffer overflow vulnerability found in the Vim text editor, which can lead to arbitrary code execution.

You can check your Vim version by running 'vim --version' in your terminal. If it is below 9.0.1873, it is vulnerable.

Exploitation of this vulnerability can lead to data corruption, unauthorized access, and system crashes, posing significant security risks.

You can update Vim by running the command 'apk add vim=9.0.2073-r0' for Alpine v3.18 or 'apk add vim=9.0.1888-r0' for Alpine v3.19 and above.

Vulert is a tool that monitors and alerts for open-source vulnerabilities in software using a manifest file. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

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