CVE-2023-5535
High · 7.8CVSS
7.8
EPSS
0.5%
Published
Oct 11, 2023
CISA due date
—
Cloudanix analysis
A flaw in a popular text editor can let attackers take over a computer when someone opens a specially prepared 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 condition in Vim's internal data structures allows an attacker-controlled pointer to reference freed memory, enabling arbitrary code execution or memory corruption when triggered by crafted input.
Why it matters to the business
Attackers may gain control of developer or administrator workstations that run vulnerable Vim versions, potentially leading to source code theft, supply-chain compromise, or lateral movement; the issue affects a ubiquitous editor used across nearly all software organizations.
How an attack unfolds
An attacker prepares a malicious text file or buffer that exercises Vim's editing and undo/redo paths; when a victim opens or edits the file in an affected Vim binary, the use-after-free is triggered, allowing the attacker to overwrite function pointers or execute shellcode.
How to fix it
Upgrade vim/vim to commit 41e6f7d6ba67b61d911f9b1d76325cd79224753d (v9.0.2010) or later; rebuild and redeploy all locally compiled binaries; verify the version string after installation.
How to confirm the fix worked
Run 'vim --version' and confirm the build includes commit 41e6f7d6ba67b61d911f9b1d76325cd79224753d; attempt to reproduce the original crash PoC in a controlled environment to confirm absence of the use-after-free.
Typical attack path
- Attacker crafts a file containing sequences that force Vim to free then reuse specific internal buffers
- Victim opens the file with vim or loads it via :e or similar commands
- Vim performs operations that dereference the dangling pointer
- Attacker-controlled data is written into freed memory, hijacking control flow
- Shellcode or ROP chain executes, establishing persistence or exfiltrating data
How to detect it
Review command-line history, shell logs, and editor swap-file artifacts for unexpected file opens; correlate with process-creation events showing Vim launching shortly before anomalous behavior; examine core dumps or crash reports for Vim segmentation faults on untrusted input.
What your security team should do
- Immediately update all developer workstations, CI runners, and servers that invoke Vim to the fixed commit
- Add Vim to the organization's patch-management policy with a 30-day SLA
- Block execution of unapproved Vim binaries via application allow-listing where feasible
- Scan source repositories for embedded or vendored Vim instances and update them
The record
Use After Free in GitHub repository vim/vim prior to v9.0.2010.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.18 | vim | 0 | 9.0.2073-r0 |
| Alpine:v3.19 | vim | 0 | 9.0.2073-r0 |
| Alpine:v3.20 | vim | 0 | 9.0.2073-r0 |
| Alpine:v3.21 | vim | 0 | 9.0.2073-r0 |
| Alpine:v3.22 | vim | 0 | 9.0.2073-r0 |
| Debian:11 | vim | 0 | No fix |
| Debian:12 | vim | 0 | No fix |
| Debian:13 | vim | 0 | 2:9.0.2018-1 |
| Mageia:8 | vim | 0 | 9.0.2059-1.mga8 |
| Mageia:9 | vim | 0 | 9.0.2059-1.mga9 |
| SUSE:Enterprise Storage 7.1 | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Micro 5.1 | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Micro 5.2 | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Micro 5.3 | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Micro 5.4 | vim | 0 | 9.0.2103-150000.5.57.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.2103-150000.5.57.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.2103-150000.5.57.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.2103-17.26.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | vim | 0 | 9.0.2103-17.26.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | vim | 0 | 9.0.2103-150000.5.57.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | vim | 0 | 9.0.2103-150000.5.57.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.2103-150000.5.57.1 |
| openSUSE:Leap 15.5 | vim | 0 | 9.0.2103-150500.20.6.1 |
| openSUSE:Leap Micro 5.3 | vim | 0 | 9.0.2103-150000.5.57.1 |
| openSUSE:Leap Micro 5.4 | vim | 0 | 9.0.2103-150000.5.57.1 |
Related vulnerabilities
- 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
- CVE-2023-4752 Use After Free in GitHub repository vim/vim prior to 9.0.1858. Also affects vim
- CVE-2023-4750 Use After Free in GitHub repository vim/vim prior to 9.0.1857. Also affects vim
- CVE-2023-4733 Use After Free in GitHub repository vim/vim prior to 9.0.1840. Also affects vim
- CVE-2023-4735 Out-of-bounds Write in GitHub repository vim/vim prior to 9.0.1847. Also affects vim
- CVE-2023-4734 Integer Overflow or Wraparound in GitHub repository vim/vim prior to 9.0.1846. Also affects vim
- CVE-2021-4019 vim is vulnerable to Heap-based Buffer Overflow Also affects vim