CVE-2023-4751
High · 7.8CVSS
7.8
EPSS
0.6%
Published
Sep 3, 2023
CISA due date
—
Cloudanix analysis
A problem in the Vim text editor can let someone take over your computer if you open a specially made file, so update to the newest version right away.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow in Vim allows out-of-bounds writes when processing specially crafted input, enabling memory corruption that can lead to arbitrary code execution or denial of service.
Why it matters to the business
Successful exploitation on developer or administrator workstations can result in full system compromise, data theft, or deployment of persistent malware, disrupting development workflows and increasing incident response costs; the large number of Vim users amplifies organizational exposure.
How an attack unfolds
An attacker crafts a malicious file that triggers the heap overflow when opened or edited in a vulnerable Vim instance; with user interaction required to load the file, the overflow is leveraged to redirect execution flow and execute attacker-supplied code on the local system.
How to fix it
Upgrade Vim to a build containing commit e1121b139480f53d1b06f84f3e4574048108fa0b (version 9.0.1331 or later). Rebuild from source or obtain updated packages from distribution repositories; verify the installed binary reports the fixed version string.
How to confirm the fix worked
Run 'vim --version' and confirm the build includes commit e1121b139480f53d1b06f84f3e4574048108fa0b or reports version 9.0.1331+. Test with known proof-of-concept files in a sandbox to ensure crashes or code execution no longer occur.
Typical attack path
- Attacker generates a specially crafted file exploiting the heap buffer overflow
- File is delivered to the target via email, download, or shared storage
- Victim opens the file using a vulnerable Vim binary
- Overflow corrupts heap memory and achieves code execution
- Attacker payload establishes persistence or exfiltrates data
How to detect it
Review command-line history, shell logs, and process execution records for invocations of vulnerable Vim binaries on untrusted files; inspect crash dumps or core files containing heap corruption patterns after Vim usage.
What your security team should do
- Immediately update all Vim installations to the fixed commit across developer endpoints and CI systems
- Block or sandbox execution of Vim on untrusted files until patched
- Monitor vulnerability disclosure channels for public exploit releases given the 'ExploitAvailable' maturity
- Educate users on risks of opening files from unknown sources in Vim
The record
Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.1331.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | vim | 0 | No fix |
| Debian:12 | vim | 0 | No fix |
| Debian:13 | vim | 0 | 2:9.0.1894-1 |
| Debian:14 | vim | 0 | 2:9.0.1894-1 |
| Ubuntu:20.04:LTS | vim | 0 | 2:8.1.2269-1ubuntu5.20 |
| Ubuntu:22.04:LTS | vim | 0 | 2:8.2.3995-1ubuntu2.13 |
| Ubuntu:23.10 | vim | 0 | 2:9.0.1672-1ubuntu2.1 |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm14 |
| Ubuntu:Pro:16.04:LTS | vim | 0 | 2:7.4.1689-3ubuntu1.5+esm20 |
| Ubuntu:Pro:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.13+esm6 |
| openSUSE:Tumbleweed | vim | 0 | 9.0.1894-1.1 |
Related vulnerabilities
- CVE-2025-29768 Vim, a text editor, is vulnerable to potential data loss with zip.vim and special crafted… Also affects vim
- CVE-2025-27423 Vim is an open source, command line text editor. Also affects vim
- CVE-2025-24014 Vim is an open source, command line text editor. Also affects vim
- CVE-2025-22134 When switching to other buffers using the :all command and visual mode still being… Also affects vim
- CVE-2024-47814 Vim is an open source, command line text editor. Also affects vim
- CVE-2024-43802 Vim is an improved version of the unix vi text editor. Also affects vim
- CVE-2024-43374 The UNIX editor Vim prior to version 9.1.0678 has a use-after-free error in argument list… Also affects vim
- CVE-2024-22667 Vim before 9.0.2142 has a stack-based buffer overflow because did_set_langmap in map.c… Also affects vim