Vim Vulnerability: Buffer Overflow Due to ASCII NUL Characters in Search Patterns

vim Updated 02 Oct 2025

Summary

22/08/2024
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2024-43790: Vim is an open source command line text editor. Affects vim versions < 2:9.1.0698-1. Fixed in 2:9.1.0698-1. 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

Vim is a widely used open-source command line text editor known for its efficiency and versatility in text manipulation. It supports various modes, including insert and command modes, allowing users to perform complex editing tasks. However, a recent vulnerability has been identified that affects Vim versions prior to 2:9.1.0698-1, specifically when handling search patterns with ASCII NUL characters, leading to potential buffer overflow issues.

Vulnerability Detail

The vulnerability arises when the search-count message is disabled in Vim, and the right-left mode is enabled. When a search pattern containing ASCII NUL characters is processed, Vim allocates a new buffer for the reversed search pattern. Due to the nature of the strlen() function, which stops counting at the first ASCII NUL byte, the allocated buffer size becomes smaller than expected. This discrepancy leads to an overflow when accessing characters in the message buffer, potentially allowing for arbitrary code execution or crashes.

How To Fix

Minimum fixed version

2:9.1.0698-1

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 search patterns that contain ASCII NUL characters or disable the right-left mode by executing ':set norl' in Vim.

Conclusion

In summary, the identified vulnerability in Vim poses a significant risk due to improper handling of search patterns with ASCII NUL characters. Users are advised to update to the latest patched version to mitigate this risk and consider using Vulert for ongoing vulnerability monitoring.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

The vulnerability is a buffer overflow caused by improper handling of search patterns containing ASCII NUL characters when right-left mode is enabled.

You can check your Vim version by running 'vim --version' in the terminal. If it is below 2:9.1.0698-1, it is affected.

Exploiting this vulnerability could lead to arbitrary code execution, crashes, or data corruption, posing significant risks to system integrity.

Yes, you can use Vulert, which monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json.

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

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

2:9.1.0698-1

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