CVE-2022-1674
Medium · 5.5CVSS
5.5
EPSS
1.6%
Published
May 12, 2022
CISA due date
—
Cloudanix analysis
A bug in the Vim text editor can make the program crash when it tries to handle certain specially crafted files or patterns, interrupting anyone's work that depends on the editor.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
NULL pointer dereference in vim_regexec_string at regexp.c:2733 causes immediate application crash on crafted regex input.
Why it matters to the business
Vim-based editing, scripting, or build pipelines can be interrupted by application crashes, leading to lost work and operational delays; widespread editor use increases exposure.
How an attack unfolds
An attacker crafts a file containing a malicious regular expression pattern that reaches vim_regexec_string; opening or processing the file triggers the null dereference and forces a crash.
How to fix it
Upgrade vim/vim to commit a59f2dfd0cf9ee1a584d3de5b7c2d47648e79060 or later (corresponding to 8.2.4938). Rebuild or reinstall from the fixed source or updated packages.
How to confirm the fix worked
Verify the installed Vim reports a version at or above 8.2.4938 or contains commit a59f2dfd0cf9ee1a584d3de5b7c2d47648e79060; attempt to open a test file that previously reproduced the crash and confirm the editor no longer terminates.
Typical attack path
- Prepare a file containing a specially crafted regular expression that triggers the vulnerable code path
- Open the file with a vulnerable Vim binary (local file or via editor invocation)
- Vim executes the regex engine and hits the null dereference in vim_regexec_string
- Application terminates with a segmentation fault or equivalent crash
How to detect it
Review system and application logs for Vim segmentation faults or abrupt terminations around the time users opened untrusted files; correlate with file-access timestamps of recently edited buffers.
What your security team should do
- Immediately update all Vim installations to the fixed commit or version 8.2.4938
- Scan build and CI systems for embedded or vendored Vim binaries and update them
- Add Vim version checks to configuration management and container base images
- Monitor crash reports from developer workstations for unexpected Vim terminations
The record
NULL Pointer Dereference in function vim_regexec_string at regexp.c:2733 in GitHub repository vim/vim prior to 8.2.4938. NULL Pointer Dereference in function vim_regexec_string at regexp.c:2733 allows attackers to cause a denial of service (application crash) via a crafted input.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | vim | 0 | No fix |
| Debian:12 | vim | 0 | 2:9.0.0135-1 |
| Debian:13 | vim | 0 | 2:9.0.0135-1 |
| Debian:14 | vim | 0 | 2:9.0.0135-1 |
| Mageia:8 | vim | 0 | 8.2.4975-1.mga8 |
| Ubuntu:18.04:LTS | vim | 0 | 2:8.0.1453-1ubuntu1.12 |
| Ubuntu:20.04:LTS | vim | 0 | 2:8.1.2269-1ubuntu5.13 |
| Ubuntu:22.04:LTS | vim | 0 | 2:8.2.3995-1ubuntu2.5 |
| Ubuntu:Pro:14.04:LTS | vim | 0 | 2:7.4.052-1ubuntu3.1+esm8 |
| Ubuntu:Pro:16.04:LTS | vim | 0 | 2:7.4.1689-3ubuntu1.5+esm13 |
| openSUSE:Tumbleweed | vim | 0 | 9.0.0453-2.1 |
Related vulnerabilities
- CVE-2025-9390 A security flaw has been discovered in vim up to 9.1.1615. Also affects vim
- CVE-2025-53905 Vim is an open source, command line text editor. Also affects vim
- CVE-2025-53906 Vim is an open source, command line text editor. Also affects vim
- 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-26603 Vim is a greatly improved version of the good old UNIX editor Vi. Also affects vim
- CVE-2025-1215 A vulnerability classified as problematic was found in vim up to 9.1.1096. Also affects vim
- CVE-2025-24014 Vim is an open source, command line text editor. Also affects vim