High severity · published Jun 11, 2026
CVE-2026-47162
Vim: Vimscript Code Injection in netrw NetrwBookHistSave() via crafted directory name
8.8
CVSS
0.3%
EPSS
No
On KEV
Description
Vim is an open source, command line text editor. Prior to version 9.2.0495, a Vimscript code injection vulnerability exists in s:NetrwBookHistSave() in the netrw plugin (runtime/pack/dist/opt/netrw/autoload/netrw.vim) when serializing browsed directory paths to the history file ~/.vim/.netrwhist. A directory name derived from the filesystem is interpolated into a single-quoted Vimscript string literal without escaping embedded single quotes, allowing a crafted directory name to break out of the string context and execute arbitrary Vimscript, including shell commands via system() and :!, the next time the history file is sourced. This issue has been patched in version 9.2.0495.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.3% · higher than 20% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
VI
vim · vim
< 9.2.0495 · source: vendor, NVD
RH
Red Hat Enterprise Linux 10 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 10.0 Extended Update Support · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 6 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 7 Extended Lifecycle Support · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 9 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Hardened Images · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Insights proxy 1.5 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat OpenShift Container Platform 4.22 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Update Infrastructure 5 · Red Hat
All versions, or not specified · source: CISA
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-47162
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-47162
Patch
https://github.com/vim/vim/commit/f08ab2f4d7d2947c8dd6c179ae08ee6146a2694b
Product
https://github.com/vim/vim/releases/tag/v9.2.0495
Vendor Advisory
https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c
access.redhat.com
https://access.redhat.com/errata/RHSA-2026:38509
access.redhat.com
https://access.redhat.com/errata/RHSA-2026:38510
access.redhat.com
https://access.redhat.com/errata/RHSA-2026:38511
More from vim
9.8
CVE-2020-20703
Buffer Overflow vulnerability in VIM v.8.1.2135 allows a remote attacker to execute arbitrary code via the operand parameter
9.8
CVE-2022-3520
Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0765
9.8
CVE-2022-0318
Heap-based Buffer Overflow in vim/vim prior to 8.2
9.8
CVE-2017-6350
An integer overflow at an unserialize_uep memory allocation site would occur for vim before patch 8.0.0378, if it does not properly validate values for tree length when reading a…
9.8
CVE-2017-6349
An integer overflow at a u_read_undo memory allocation site would occur for vim before patch 8.0.0377, if it does not properly validate values for tree length when reading a…
