CVE-2022-1785
High · 7.8CVSS
7.8
EPSS
0.5%
Published
May 19, 2022
CISA due date
—
Cloudanix analysis
A bug in the Vim text editor lets someone who can trick you into opening a bad file take over your computer or crash the program.
- 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
Out-of-bounds write in Vim's memory handling routines allowing arbitrary memory corruption when processing specially crafted input.
Why it matters to the business
Local attackers can achieve code execution or denial of service on developer and administrator workstations that run Vim, increasing risk of credential theft or lateral movement in environments where editors process untrusted files.
How an attack unfolds
An attacker supplies a malicious file or buffer that triggers the out-of-bounds write during parsing or editing operations in a vulnerable Vim binary; with an available public exploit the attacker can control the overwritten memory to execute arbitrary code under the privileges of the Vim process.
How to fix it
Upgrade vim/vim to commit e2bd8600b873d2cd1f9d667c28cba8b1dba18839 or later; rebuild and redeploy all affected binaries; verify the new version string after installation.
How to confirm the fix worked
Run 'vim --version' and confirm the build contains commit e2bd8600b873d2cd1f9d667c28cba8b1dba18839; attempt reproduction with known trigger files in a controlled environment to confirm the crash no longer occurs.
Typical attack path
- Identify or create a file that triggers the vulnerable code path in Vim
- Convince a target user or automated process to open the file with a vulnerable Vim binary
- Trigger the out-of-bounds write to corrupt memory and gain code execution
- Execute payload to read sensitive files, install persistence, or move laterally
How to detect it
Review system and application logs for Vim segmentation faults or abnormal memory access around the time untrusted files were opened; correlate with file creation or download events preceding the crash.
What your security team should do
- Prioritize patching all developer and server instances of Vim within the next 30 days given public exploit availability
- Add Vim version checks to software inventory and CI pipelines
- Block execution of unpatched Vim binaries via endpoint policy where feasible
- Monitor for unusual Vim process behavior on high-value systems
The record
Out-of-bounds Write in GitHub repository vim/vim prior to 8.2.4977.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:8 | vim-X11 | 0 | 2:8.0.1763-19.el8_6.4 |
| AlmaLinux:8 | vim-common | 0 | 2:8.0.1763-19.el8_6.4 |
| AlmaLinux:8 | vim-enhanced | 0 | 2:8.0.1763-19.el8_6.4 |
| AlmaLinux:8 | vim-filesystem | 0 | 2:8.0.1763-19.el8_6.4 |
| AlmaLinux:8 | vim-minimal | 0 | 2:8.0.1763-19.el8_6.4 |
| AlmaLinux:9 | vim-X11 | 0 | 2:8.2.2637-16.el9_0.3 |
| AlmaLinux:9 | vim-common | 0 | 2:8.2.2637-16.el9_0.3 |
| AlmaLinux:9 | vim-enhanced | 0 | 2:8.2.2637-16.el9_0.3 |
| AlmaLinux:9 | vim-filesystem | 0 | 2:8.2.2637-16.el9_0.3 |
| AlmaLinux:9 | vim-minimal | 0 | 2:8.2.2637-16.el9_0.3 |
| Debian:10 | vim | 0 | 2:8.1.0875-5+deb10u4 |
| Debian:11 | vim | 0 | No fix |
| Debian:11 | vim | 0 | 2:8.2.2434-3+deb11u2 |
| Debian:12 | vim | 0 | 2:9.0.0135-1 |
| Debian:13 | vim | 0 | 2:9.0.0135-1 |
| Red Hat:enterprise_linux:8::appstream | vim | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-X11 | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-X11-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-common | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-common-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-debugsource | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-enhanced | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-enhanced-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-filesystem | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-minimal | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::appstream | vim-minimal-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-X11 | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-X11-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-common | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-common-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-debugsource | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-enhanced | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-enhanced-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-filesystem | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-minimal | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:8::baseos | vim-minimal-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:enterprise_linux:9::appstream | vim | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-X11 | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-X11-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-common | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-common-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-debugsource | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-enhanced | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-enhanced-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-filesystem | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-minimal | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::appstream | vim-minimal-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-X11 | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-X11-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-common | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-common-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-debugsource | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-enhanced | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-enhanced-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-filesystem | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-minimal | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:enterprise_linux:9::baseos | vim-minimal-debuginfo | 0 | 2:8.2.2637-16.el9_0.3 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-X11 | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-X11-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-common | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-common-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-debugsource | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-enhanced | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-enhanced-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-filesystem | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-minimal | 0 | 2:8.0.1763-19.el8_6.4 |
| Red Hat:rhev_hypervisor:4.4::el8 | vim-minimal-debuginfo | 0 | 2:8.0.1763-19.el8_6.4 |
| Rocky Linux:8 | vim | 0 | 2:8.0.1763-19.el8_6.4 |
| Rocky Linux:9 | vim | 0 | 2:8.2.2637-16.el9_0.3 |
| SUSE:Enterprise Storage 6 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Enterprise Storage 7 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Micro 5.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Micro 5.2 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP3 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP4 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP4 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 12 SP2-BCL | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 12 SP3-BCL | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 12 SP4-LTSS | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 12 SP5 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server 15 SP1-BCL | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15 SP2-BCL | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server 15-LTSS | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Manager Proxy 4.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Manager Retail Branch Server 4.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:Manager Server 4.1 | vim | 0 | 8.2.5038-150000.5.21.1 |
| SUSE:OpenStack Cloud 9 | vim | 0 | 9.0.0814-17.9.1 |
| SUSE:OpenStack Cloud Crowbar 9 | vim | 0 | 9.0.0814-17.9.1 |
| 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+esm8 |
| openSUSE:Leap 15.3 | vim | 0 | 8.2.5038-150000.5.21.1 |
| openSUSE:Leap 15.4 | vim | 0 | 8.2.5038-150000.5.21.1 |
| openSUSE:Tumbleweed | vim | 0 | 9.0.0453-2.1 |
Related vulnerabilities
- CVE-2022-1927 Buffer Over-read in GitHub repository vim/vim prior to 8.2. Also affects vim-X11
- CVE-2022-1897 Out-of-bounds Write in GitHub repository vim/vim prior to 8.2. Also affects vim-X11
- CVE-2022-0318 Heap-based Buffer Overflow in vim/vim prior to 8.2. Also affects vim-X11
- CVE-2022-0261 Heap-based Buffer Overflow in GitHub repository vim/vim prior to 8.2. Also affects vim-X11
- CVE-2021-4019 vim is vulnerable to Heap-based Buffer Overflow Also affects vim-X11
- CVE-2023-4752 Use After Free in GitHub repository vim/vim prior to 9.0.1858. Also affects vim-X11
- CVE-2022-1420 Use of Out-of-range Pointer Offset in GitHub repository vim/vim prior to 8.2.4774. Also affects vim-X11
- CVE-2022-0554 Use of Out-of-range Pointer Offset in GitHub repository vim/vim prior to 8.2. Also affects vim-X11