CVE-2026-47162

Vim: Vimscript Code Injection in netrw NetrwBookHistSave() via crafted directory name

HIGH
8.8
CVSS Score
Published: June 11, 2026 at 06:32 PM UTC
Updated: September 18, 2026 at 02:29 PM UTC
3 products affected across 2 vendorsVimEnterprise LinuxHardened Images

Using vim by vim?

Get instant alerts when new vulnerabilities affect vim - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.8
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 9.2.0495
Affected range stops below 9.2.0495, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 2:7.4.629-8.el7_9.2 (unaffected)
Vendor states this is fixed in 2:8.0.1763-27.el8_10 (unaffected)
Vendor states this is fixed in 2:8.2.2637-26.el9_8.10 (unaffected)
Vendor states this is fixed in 2:9.1.083-5.el10_0.4 (unaffected)
Vendor states this is fixed in 2:9.1.083-9.el10_2.7 (unaffected)
All versions

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (14)

x_refsource_CONFIRMVendor Advisory
Source: cverecord
https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c
x_refsource_MISCProduct
Source: cverecord
https://github.com/vim/vim/releases/tag/v9.2.0495
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/security/cve/CVE-2026-47162
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://bugzilla.redhat.com/show_bug.cgi?id=2487964
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:38509
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:38510

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-74CWE-94CWE-140

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card