CVE-2023-4752
High · 7.8CVSS
7.8
EPSS
0.6%
Published
Sep 4, 2023
CISA due date
—
Cloudanix analysis
A problem in the Vim text editor could let someone take over your computer if you open a specially made file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Use-after-free in Vim leads to memory corruption that can be leveraged for arbitrary code execution or denial of service when processing crafted input.
Why it matters to the business
Attackers can fully compromise developer workstations or servers running vulnerable Vim, resulting in data theft, lateral movement, or ransomware deployment on systems that edit untrusted files.
How an attack unfolds
An attacker prepares a malicious file or buffer that triggers the use-after-free when opened or edited in Vim; because a public exploit exists, the attacker can deliver the file via email, download, or repository and achieve code execution under the privileges of the Vim process.
How to fix it
Upgrade vim/vim to commit ee9166eb3b41846661a39b662dc7ebe8b5e15139 or release 9.0.1858 or later; rebuild from source or install the patched package from your distribution once available.
How to confirm the fix worked
Run 'vim --version' and confirm the version string shows 9.0.1858 or newer; attempt to open a known triggering file with ASAN or valgrind enabled to verify absence of the use-after-free.
Typical attack path
- Locate or create a file that triggers the use-after-free condition in vulnerable Vim
- Deliver the file to the target (email attachment, cloned repository, shared drive)
- Convince the user to open the file with Vim (or have Vim invoked automatically)
- Exploit the freed memory to execute attacker-controlled code or crash the process
How to detect it
Review system and application logs for unexpected Vim crashes or segmentation faults; inspect process creation events where Vim opens files from untrusted sources; correlate with memory sanitizer reports if available in development environments.
What your security team should do
- Immediately update all Vim installations to the fixed commit or version 9.0.1858+
- Block or sandbox execution of Vim on untrusted files until patches are applied
- Add Vim binary and process execution to endpoint monitoring for anomalous behavior
The record
Use After Free in GitHub repository vim/vim prior to 9.0.1858.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:9 | vim-X11 | 0 | 2:8.2.2637-22.el9_6 |
| AlmaLinux:9 | vim-common | 0 | 2:8.2.2637-22.el9_6 |
| AlmaLinux:9 | vim-enhanced | 0 | 2:8.2.2637-22.el9_6 |
| AlmaLinux:9 | vim-filesystem | 0 | 2:8.2.2637-22.el9_6 |
| AlmaLinux:9 | vim-minimal | 0 | 2:8.2.2637-22.el9_6 |
| Alpine:v3.18 | vim | 0 | 9.0.2073-r0 |
| Alpine:v3.19 | vim | 0 | 9.0.1888-r0 |
| Alpine:v3.20 | vim | 0 | 9.0.1888-r0 |
| Alpine:v3.21 | vim | 0 | 9.0.1888-r0 |
| Alpine:v3.22 | vim | 0 | 9.0.1888-r0 |
| Debian:10 | vim | 0 | 2:8.1.0875-5+deb10u6 |
| Debian:11 | vim | 0 | No fix |
| Debian:11 | vim | 0 | 2:8.2.2434-3+deb11u2 |
| Debian:12 | vim | 0 | No fix |
| Debian:13 | vim | 0 | 2:9.0.1894-1 |
| Debian:14 | vim | 0 | 2:9.0.1894-1 |
| SUSE:Enterprise Storage 7.1 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Micro 5.1 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Micro 5.2 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Micro 5.3 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Micro 5.4 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Micro 5.5 | vim | 0 | 9.0.2103-150500.20.6.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP4 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP5 | vim | 0 | 9.0.2103-150500.20.6.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP4 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP5 | vim | 0 | 9.0.2103-150500.20.6.1 |
| SUSE:Linux Enterprise Server 12 SP5 | vim | 0 | 9.0.1894-17.23.2 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | vim | 0 | 9.0.1894-17.23.2 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Manager Proxy 4.2 | vim | 0 | 9.0.1894-150000.5.54.1 |
| SUSE:Manager Server 4.2 | vim | 0 | 9.0.1894-150000.5.54.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:Leap 15.4 | vim | 0 | 9.0.1894-150000.5.54.1 |
| openSUSE:Leap 15.5 | vim | 0 | 9.0.2103-150500.20.6.1 |
Related vulnerabilities
- CVE-2022-1927 Buffer Over-read in GitHub repository vim/vim prior to 8.2. Also affects vim-X11
- CVE-2022-1897 Out-of-bounds Write in GitHub repository vim/vim prior to 8.2. Also affects vim-X11
- CVE-2022-1785 Out-of-bounds Write in GitHub repository vim/vim prior to 8.2.4977. Also affects vim-X11
- CVE-2022-1420 Use of Out-of-range Pointer Offset in GitHub repository vim/vim prior to 8.2.4774. Also affects vim-X11
- CVE-2022-0554 Use of Out-of-range Pointer Offset in GitHub repository vim/vim prior to 8.2. Also affects vim-X11
- CVE-2023-5535 Use After Free in GitHub repository vim/vim prior to v9.0.2010. Also affects vim
- CVE-2023-5344 Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.1969. Also affects vim
- CVE-2023-4781 Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.1873. Also affects vim