CVE-2026-47162: Vim: Vimscript Code Injection in netrw NetrwBookHistSave() via crafted directory name

Published Jun 11, 2026
·
Updated

Last updated 19 June 2026

Other sources

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.

MITRE

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

Microsoft

Affected Software

4 affected componentsFixes available
vim Vim<9.2.0495
vim Vim<9.2.0495
debian/vim<=2:8.2.2434-3+deb11u1, <=2:8.2.2434-3+deb11u3, <=2:9.0.1378-2+deb12u2, <=2:9.1.1230-2
2:9.2.0524-1
Microsoft azl3 vim 9.2.0488-1<9.2.0620-1
9.2.0620-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/vim to a version that resolves this vulnerability.

    Fixed in 2:9.2.0524-1
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 9.2.0620-1
  3. Upgrade

    Upgrade Vim netrw plugin (runtime/pack/dist/opt/netrw/autoload/netrw.vim) to a version that resolves this vulnerability.

    Fixed in 9.2.0495

Event History

Jun 11, 2026
CVE Published
via MITRE·06:32 PM
Data Sourced
via MITRE·06:32 PM
DescriptionWeakness
Data Sourced
via Red Hat·07:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·07:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jun 13, 2026
Data Sourced
via Microsoft·08:01 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·08:01 AM
Affected Software
Updated
via Microsoft·08:01 AM
DescriptionSeverity
Jun 18, 2026
Data Sourced
via Debian·06:48 PM
DescriptionAffected Software
Data Sourced
via Launchpad·06:48 PM
Description
Jun 19, 2026
Data Sourced
via Ubuntu·06:48 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-47162?

CVE-2026-47162 has a severity rating of high, with a CVSS score of 7.3.

2

How do I fix CVE-2026-47162?

To resolve CVE-2026-47162, you should update Vim to version 9.2.0495 or later.

3

What is CVE-2026-47162 about?

CVE-2026-47162 is a vulnerability in Vim that allows for Vimscript code injection through crafted directory names in the netrw plugin.

4

Who is affected by CVE-2026-47162?

Users of Vim versions prior to 9.2.0495 who utilize the netrw plugin are affected by CVE-2026-47162.

5

What are the potential impacts of CVE-2026-47162?

CVE-2026-47162 can lead to unauthorized code execution due to the code injection vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203