CVE-2024-47814
NoneCVSS
—
EPSS
0.3%
Published
Oct 7, 2024
CISA due date
—
Cloudanix analysis
A rare crash bug exists in the Vim text editor that can only be triggered by very specific custom settings when closing files.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- High
- Impact
- Denial Of Service
- Component
- Application
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Use-after-free in buffer close handling triggered when a BufWinLeave autocmd reopens the same buffer in a new split window.
Why it matters to the business
Potential editor crashes for users with custom buffer-handling automation; minimal operational disruption given the narrow preconditions.
How an attack unfolds
An attacker with the ability to influence a target's Vim configuration plants a BufWinLeave autocmd that reopens the buffer being closed; subsequent buffer unload commands trigger the use-after-free and possible crash. No widespread exploitation observed.
How to fix it
Upgrade vim/vim to the commit 51b62387be93c65fa56bbabe1c3c1ea5df187641 (Vim 9.1.0764) or later; no workarounds exist.
How to confirm the fix worked
Confirm Vim version reports 9.1.0764 or newer; verify the listed commit is present in the source tree.
Typical attack path
- Configure BufWinLeave autocmd that reopens the target buffer in a split window
- Execute buffer close or unload commands
- Trigger use-after-free during window/buffer teardown
How to detect it
Review Vim configuration files and logs for BufWinLeave autocmds that reopen buffers; inspect crash reports or core dumps showing buffer teardown faults. No public exploitation artifacts are known.
What your security team should do
- Upgrade all Vim installations to the fixed commit immediately
- Audit custom vimrc and plugin autocmds for buffer lifecycle handlers
- Monitor upstream Vim releases for related buffer-handling fixes
The record
Vim is an open source, command line text editor. A use-after-free was found in Vim < 9.1.0764. When closing a buffer (visible in a window) a BufWinLeave auto command can cause an use-after-free if this auto command happens to re-open the same buffer in a new split window. Impact is low since the user must have intentionally set up such a strange auto command and run some buffer unload commands. However this may lead to a crash. This issue has been addressed in version 9.1.0764 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.21 | vim | 0 | 9.1.0936-r0 |
| Alpine:v3.22 | vim | 0 | 9.1.0936-r0 |
| Chainguard | vim | 0 | 9.1.0766-r0 |
| Chainguard | vim-doc | 0 | 9.1.0766-r0 |
| 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 | No fix |
| Debian:14 | vim | 0 | 2:9.1.0777-1 |
| Mageia:9 | vim | 0 | 9.1.771-1.mga9 |
| SUSE:Linux Enterprise Micro 5.5 | vim | 0 | 9.1.0836-150500.20.15.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP5 | vim | 0 | 9.1.0836-150500.20.15.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | vim | 0 | 9.1.0836-150500.20.15.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP5 | vim | 0 | 9.1.0836-150500.20.15.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 | vim | 0 | 9.1.0836-150500.20.15.1 |
| SUSE:Linux Enterprise Server 12 SP5-LTSS | vim | 0 | 9.1.0836-17.38.1 |
| SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | vim | 0 | 9.1.0836-17.38.1 |
| Ubuntu:20.04:LTS | vim | 0 | 2:8.1.2269-1ubuntu5.29 |
| Ubuntu:22.04:LTS | vim | 0 | 2:8.2.3995-1ubuntu2.21 |
| Ubuntu:24.04:LTS | vim | 0 | 2:9.1.0016-1ubuntu7.5 |
| Ubuntu:24.10 | vim | 0 | 2:9.1.0496-1ubuntu6.2 |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm20 |
| Ubuntu:Pro:16.04:LTS | vim | 0 | 2:7.4.1689-3ubuntu1.5+esm26 |
| Ubuntu:Pro:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.13+esm11 |
| Wolfi | vim | 0 | 9.1.0766-r0 |
| Wolfi | vim-doc | 0 | 9.1.0766-r0 |
| openSUSE:Leap 15.5 | vim | 0 | 9.1.0836-150500.20.15.1 |
| openSUSE:Leap 15.6 | vim | 0 | 9.1.0836-150500.20.15.1 |
| openSUSE:Leap Micro 5.5 | vim | 0 | 9.1.0836-150500.20.15.1 |
Related vulnerabilities
- 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-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-2023-48706 Vim is a UNIX editor that, prior to version 9.0.2121, has a heap-use-after-free… Also affects vim
- CVE-2023-48231 Vim is an open source command line text editor. Also affects vim
- 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