Heap Use-After-Free Vulnerability in Vim Package
Summary
DEBIAN-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 < 2:9.0.2189-1. Fixed in 2:9.0.2189-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 highly configurable text editor built to enable efficient text editing. It is widely used in UNIX environments and 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 memory access issues.
Vulnerability Detail
The vulnerability arises when executing a ':s' command for the first time while using a sub-replace-special atom in the substitution part. This can lead to a recursive ':s' call that inadvertently frees memory, which may later be accessed by the initial ':s' command. This flaw can cause crashes in Vim and requires the user to intentionally execute a specific payload, making it somewhat tricky to exploit reliably.
How To Fix
Minimum fixed version
2:9.0.2189-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
Currently, there are no specific workarounds mentioned for this vulnerability. The best course of action is to update to the patched version as soon as possible.
Conclusion
The heap-use-after-free vulnerability in Vim poses a significant risk to users running versions prior to 9.0.2121. It is crucial to update to the patched version to mitigate potential crashes and security risks. Regular monitoring for vulnerabilities using tools like Vulert can help maintain software security.
See every vulnerability recorded for vim →
FAQ
A heap-use-after-free vulnerability occurs when a program continues to use a memory location after it has been freed, potentially leading to crashes or arbitrary code execution.
You can check your version of Vim by running 'vim --version' in the terminal. If it is below 2:9.0.2189-1, it is affected.
While the vulnerability requires specific conditions to be met, it can be exploited by a knowledgeable user who intentionally executes the payload.
Exploitation of this vulnerability can lead to crashes in Vim and may allow an attacker to execute arbitrary code, compromising the system.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using a manifest file like package-lock.json. You can check for vulnerabilities without signup at the Vulert playground.
References
Related vulnerabilities
Recent vulnerabilities recorded for vim.