Vim Buffer Overflow Vulnerability - CVE-2024-43790
Summary
UBUNTU-CVE-2024-43790: Vim is an open source command line text editor. Affects vim versions 2:7.4.000-1ubuntu2 – 2:7.4.052-1ubuntu3.1+esm9. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
Vim is a widely used open-source command line text editor known for its efficiency and versatility in editing text files. It supports various programming languages and offers features like syntax highlighting, multi-level undo, and customizable key mappings. However, it is susceptible to vulnerabilities that can compromise its functionality and user security.
Vulnerability Detail
The vulnerability identified as CVE-2024-43790 arises when Vim performs a search while displaying the search-count message is disabled. In this scenario, if the right-left mode is enabled and the search pattern contains ASCII NUL characters, it leads to a buffer overflow. This occurs because the buffer allocated for the reversed search pattern is smaller than the original due to the strlen() function's behavior, which stops counting at the first NUL byte. Consequently, this can cause memory corruption and potentially allow an attacker to execute arbitrary code.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can avoid enabling the right-left mode (:set rl) while performing searches in Vim until the package is updated to the patched version.
Conclusion
The CVE-2024-43790 vulnerability in Vim poses a significant risk due to its potential for buffer overflow and arbitrary code execution. Users are advised to update their Vim installations to the latest patched version to mitigate these risks. Additionally, utilizing tools like Vulert can help in monitoring and managing open-source vulnerabilities effectively.
See every vulnerability recorded for vim →
FAQ
CVE-2024-43790 is a vulnerability in Vim that can lead to a buffer overflow when certain conditions are met during text searches.
You can check your Vim version by running 'vim --version' in the terminal. If it is below the patched version (v9.1.0689), it is vulnerable.
Exploiting this vulnerability could allow an attacker to execute arbitrary code, potentially compromising the user's system.
Yes, tools like Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software without requiring code access.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability by simply uploading your manifest file.
Related vulnerabilities
Recent vulnerabilities recorded for vim.