CVE-2024-22667
High · 7.8CVSS
7.8
EPSS
0.6%
Published
Feb 5, 2024
CISA due date
—
Cloudanix analysis
A problem in the Vim text editor could let someone who already has access to your computer run harmful programs by exploiting a memory flaw during certain settings changes.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Stack-based buffer overflow in did_set_langmap in map.c due to unsafe sprintf writes to an error buffer passed to option callback functions, enabling memory corruption that may lead to arbitrary code execution or crashes.
Why it matters to the business
Local attackers could gain code execution on developer or server systems using vulnerable Vim, resulting in unauthorized access, data exposure, or disruption of editing and automation workflows.
How an attack unfolds
An attacker with local access supplies crafted input or configuration that triggers the langmap option callback, causing sprintf to overflow the stack buffer and corrupt adjacent memory for control-flow hijacking.
How to fix it
Upgrade Vim to the version containing commit b39b240c386a5a29241415541f1c99e2e6b8ce47 or later.
How to confirm the fix worked
Confirm Vim version 9.0.2142 or newer and verify presence of the fixing commit in the source.
Typical attack path
- Obtain local access or user privileges on the target system
- Craft malicious langmap value or configuration that invokes the vulnerable option path
- Trigger did_set_langmap through normal option processing or startup
- Leverage overflow to execute arbitrary code or crash the process
How to detect it
Inspect system and application logs for Vim segmentation faults or abnormal terminations; review command history and configuration files for suspicious langmap settings.
What your security team should do
- Immediately update all Vim installations to the fixed commit
- Limit local user privileges on systems where Vim runs with elevated access
- Review and harden vimrc and environment configurations for untrusted input
The record
Vim before 9.0.2142 has a stack-based buffer overflow because did_set_langmap in map.c calls sprintf to write to the error buffer that is passed down to the option callback functions.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| 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.2189-1 |
| Mageia:9 | vim | 0 | 9.1.111-1.mga9 |
| SUSE:Enterprise Storage 7.1 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Micro 5.1 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Micro 5.2 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Micro 5.3 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Micro 5.4 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Micro 5.5 | vim | 0 | 9.1.0111-150500.20.9.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP5 | vim | 0 | 9.1.0111-150500.20.9.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP5 | vim | 0 | 9.1.0111-150500.20.9.1 |
| SUSE:Linux Enterprise Server 12 SP5 | vim | 0 | 9.1.0111-17.29.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | vim | 0 | 9.1.0111-17.29.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Manager Proxy 4.3 | vim | 0 | 9.1.0111-150000.5.60.1 |
| SUSE:Manager Server 4.3 | vim | 0 | 9.1.0111-150000.5.60.1 |
| Ubuntu:20.04:LTS | vim | 0 | 2:8.1.2269-1ubuntu5.22 |
| Ubuntu:22.04:LTS | vim | 0 | 2:8.2.3995-1ubuntu2.16 |
| Ubuntu:23.10 | vim | 0 | 2:9.0.1672-1ubuntu2.3 |
| Ubuntu:24.04:LTS | vim | 0 | 2:9.1.0-1ubuntu1 |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm16 |
| Ubuntu:Pro:16.04:LTS | vim | 0 | 2:7.4.1689-3ubuntu1.5+esm23 |
| Ubuntu:Pro:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.13+esm8 |
| openSUSE:Leap 15.5 | vim | 0 | 9.1.0111-150500.20.9.1 |
| openSUSE:Leap Micro 5.3 | vim | 0 | 9.1.0111-150000.5.60.1 |
| openSUSE:Leap Micro 5.4 | vim | 0 | 9.1.0111-150000.5.60.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-2023-48706 Vim is a UNIX editor that, prior to version 9.0.2121, has a heap-use-after-free… Also affects vim