Critical Use After Free Vulnerability in Vim Package
Summary
UBUNTU-CVE-2022-1154: Use after free in utf_ptr2char in GitHub repository vim/vim prior to 8.2.4646. Affects vim versions < 2:7.4.052-1ubuntu3.1+esm5. Fixed in 2:7.4.052-1ubuntu3.1+esm5. 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 by developers and system administrators for its powerful features and extensibility. The package is available across various Linux distributions, including Ubuntu. This vulnerability affects multiple versions of Vim, particularly those prior to 8.2.4646, exposing users to potential security risks.
Vulnerability Detail
The vulnerability, identified as CVE-2022-1154, is a use after free issue in the utf_ptr2char function within the Vim codebase. This flaw can be exploited by an attacker to execute arbitrary code, potentially leading to system compromise. The vulnerability arises from improper memory management, allowing an attacker to manipulate memory after it has been freed, which can result in unexpected behavior or crashes.
How To Fix
Minimum fixed version
2:7.4.052-1ubuntu3.1+esm5
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 opening untrusted files in Vim or disable certain features that may trigger the vulnerability until the package is updated. However, the best course of action is to apply the patch as soon as it is available.
Conclusion
The CVE-2022-1154 vulnerability in Vim poses a significant risk to users, allowing for potential arbitrary code execution due to improper memory management. It is crucial for users to update their Vim installations to the latest patched versions to safeguard against this vulnerability.
See every vulnerability recorded for vim →
FAQ
CVE-2022-1154 is a critical vulnerability in the Vim text editor that allows for use after free, potentially leading to arbitrary code execution.
You can check your Vim version by running 'vim --version' in the terminal. If it is below 2:8.2.4646, it is vulnerable.
If immediate updates are not possible, avoid opening untrusted files in Vim and consider disabling features that may expose the vulnerability.
More information can be found in the Ubuntu Security Notices and the official Vim GitHub repository.
Vulert monitors open-source vulnerabilities in your software by analyzing the manifest file like package-lock.json, providing real-time alerts without requiring code access.
Related vulnerabilities
Recent vulnerabilities recorded for vim.