CVE-2023-4733
High · 7.8CVSS
7.8
EPSS
0.5%
Published
Sep 4, 2023
CISA due date
—
Cloudanix analysis
A problem in the Vim text editor could let attackers take control of 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 allows arbitrary code execution or denial of service when a crafted file is opened.
Why it matters to the business
Attackers could compromise developer and administrator workstations running vulnerable Vim, enabling data theft or lateral movement. The issue has been public for over three years with public exploits available.
How an attack unfolds
An attacker crafts a file that triggers the use-after-free during Vim buffer or undo processing. When a victim opens the file, the dangling pointer is dereferenced to achieve code execution under the user's privileges.
How to fix it
Upgrade Vim to the version containing commit e1dc9a627536304bc4f738c21e909ad9fcf3974c or later.
How to confirm the fix worked
Verify the installed Vim binary reports a version built after commit e1dc9a627536304bc4f738c21e909ad9fcf3974c and test with known trigger files.
Typical attack path
- Create a malicious file that triggers the use-after-free
- Deliver the file through email, downloads, or repositories
- Victim opens the file using a vulnerable Vim instance
- Freed memory is reused for attacker-controlled data leading to code execution
How to detect it
Monitor for Vim process crashes or unexpected memory access patterns when opening files from untrusted sources; review system logs for anomalous child processes spawned by Vim.
What your security team should do
- Immediately update all Vim installations to a fixed version
- Scan source repositories and build pipelines for vulnerable Vim usage
- Restrict execution of untrusted files with Vim on high-value systems
The record
Use After Free in GitHub repository vim/vim prior to 9.0.1840.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| 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: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 |
| Mageia:8 | vim | 0 | 9.0.1882-1.mga8 |
| Mageia:9 | vim | 0 | 9.0.1882-1.mga9 |
| 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-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
- 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-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