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

- Priority: **Routine**
- Reason: Not severe (CVSS 7.3, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-06-11 · Modified: 2026-09-18
- Aliases: UBUNTU-CVE-2026-47162, DEBIAN-CVE-2026-47162
- Record: https://cvemate.com/vulnerability/CVE-2026-47162 · JSON: https://cvemate.com/vulnerability/CVE-2026-47162/json

## Description

```text
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.
```

## Signals

- CVSS: 8.8 high (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 0.275%, percentile 21.258%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian vim (Debian): All versions (No fix recorded) \| \< 2:9.1.1230-2+deb13u1 \| \< 2:9.2.0524-1
- ubuntu vim (Ubuntu): \< 2:7.4.052-1ubuntu3.1+esm29 \| \< 2:7.4.1689-3ubuntu1.5+esm35 \| \< 2:8.0.1453-1ubuntu1.13+esm20 \| \< 2:8.1.2269-1ubuntu5.32+esm8 \| \< 2:8.2.3995-1ubuntu2.32 \| \< 2:9.1.0016-1ubuntu7.16 \| \< 2:9.1.0967-1ubuntu6.7 \| \< 2:9.1.2141-1ubuntu4.5
- vim vim: \< 9.2.0495

## References

- <https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c>
- <https://github.com/vim/vim/commit/f08ab2f4d7d2947c8dd6c179ae08ee6146a2694b>
- <https://github.com/vim/vim/releases/tag/v9.2.0495>
- <https://access.redhat.com/security/cve/CVE-2026-47162>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2487964>
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-47162.json>
- <https://access.redhat.com/errata/RHSA-2026:68711>
- <https://access.redhat.com/errata/RHSA-2026:54769>
- <https://access.redhat.com/errata/RHSA-2026:55431>
- <https://access.redhat.com/errata/RHSA-2026:38509>
- <https://access.redhat.com/errata/RHSA-2026:38510>
- <https://access.redhat.com/errata/RHSA-2026:38511>
- <https://access.redhat.com/errata/RHSA-2026:53371>
- <https://access.redhat.com/errata/RHSA-2026:58981>
- <https://ubuntu.com/security/CVE-2026-47162>
- <https://www.cve.org/CVERecord?id=CVE-2026-47162>
- <https://ubuntu.com/security/notices/USN-8451-1>
- <https://security-tracker.debian.org/tracker/CVE-2026-47162>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-47162>

---

Data as of 2026-12-05T04:08:14.507Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
