Heap Use-After-Free Vulnerability in Vim Package
Summary
ALPINE-CVE-2023-48706: Vim is a UNIX editor that, prior to version 9.0.2121, has a heap-use-after-free vulnerability. Affects vim versions < 9.0.2127-r0. Fixed in 9.0.2127-r0. 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 highly configurable text editor built to enable efficient text editing. It is widely used in UNIX environments for programming and general text manipulation. The package is known for its powerful features, including syntax highlighting, multi-level undo, and extensive plugin support. However, prior to version 9.0.2121, Vim was susceptible to a heap-use-after-free vulnerability that could lead to crashes or unintended behavior.
Vulnerability Detail
The vulnerability arises from a flaw in the handling of memory during the execution of the ':s' command, particularly when using a sub-replace-special atom. This can lead to a situation where memory that has already been freed is accessed again, potentially causing a crash or allowing for arbitrary code execution. The issue is particularly tricky as it reliably occurs only during the first execution of the ':s' command, requiring user interaction to exploit.
How To Fix
Minimum fixed version
9.0.2127-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 measure, users are advised to avoid using the ':s' command with sub-replace-special atoms until the package is updated to the fixed version.
Conclusion
The heap-use-after-free vulnerability in Vim poses significant risks, including potential crashes and security exploits. Users are strongly encouraged to update to the patched version to mitigate these risks. Utilizing tools like Vulert can further enhance security by providing real-time monitoring for vulnerabilities.
See every vulnerability recorded for vim →
FAQ
It is a type of memory corruption vulnerability where a program continues to use memory after it has been freed, potentially leading to crashes or security exploits.
You can check your Vim version by running the command 'vim --version' in your terminal. If it is below 9.0.2127, it is vulnerable.
Not addressing this vulnerability could lead to crashes of the Vim editor or, in some cases, allow an attacker to execute arbitrary code.
Yes, you can use tools like Vulert, which monitors open-source vulnerabilities in your software using a manifest file like package-lock.json.
Vulert provides real-time alerts for open-source vulnerabilities, allowing developers to quickly address issues without needing to access the code directly.
References
Related vulnerabilities
Recent vulnerabilities recorded for vim.