Double-Free Vulnerability in Vim Package Leading to Potential Crashes
Summary
DEBIAN-CVE-2024-41965: 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 ↓
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 extensibility. It supports various programming languages and offers features like syntax highlighting, multi-level undo, and a powerful search and replace functionality. However, it is susceptible to vulnerabilities that can compromise its stability and security, such as the double-free issue identified in this report.
Vulnerability Detail
The vulnerability arises from a double-free error in the dialog_changed() function in Vim versions prior to v9.1.0648. When a user abandons a buffer and opts to save changes, Vim may create a new Untitled file if the buffer lacks a name. However, during the process of renaming the buffer to 'Unnamed', Vim erroneously frees a pointer twice. This double-free can lead to a heap-use-after-free condition, potentially causing crashes and unpredictable behavior in the application.
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 abandoning buffers with unsaved changes until they have updated to the patched version. Additionally, regularly saving changes to buffers can help mitigate the risk of encountering this issue.
Conclusion
The double-free vulnerability in the Vim package poses a significant risk to users, potentially leading to application crashes and data loss. It is crucial for users to update to the patched version to mitigate these risks. Regular monitoring for vulnerabilities using tools like Vulert can help maintain software security.
See every vulnerability recorded for vim →
FAQ
A double-free vulnerability occurs when a program attempts to free the same memory location more than once, which can lead to memory corruption and crashes.
You can check if your Vim installation is affected by using the Vulert playground at Vulert Scanner, which allows you to monitor for open-source vulnerabilities without requiring any signup.
The consequences may include application crashes, data loss, and potential exploitation by malicious actors to execute arbitrary code.
Yes, if the application crashes unexpectedly while handling modified buffers, there is a risk of losing unsaved changes.
It is recommended to regularly check for updates and apply patches as soon as they are released to minimize the risk of vulnerabilities.
References
Related vulnerabilities
Recent vulnerabilities recorded for vim.