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

- Severity: High 7.3 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.27%, higher than 21% of CVEs (2026-12-01)
- Published: 2026-06-11T18:32:14.471Z
- Modified: 2026-09-18T13:18:28.190Z
- Weaknesses: CWE-74, CWE-94, CWE-140
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- vim vim: < 9.2.0495; before 9.2.0495
- vim: no versions given (not affected: from 2:9.1.083-9.el10_2.7 before *; from 2:9.1.083-5.el10_0.4 before *; from 2:7.4.629-8.el7_9.2 before *; from 2:8.0.1763-27.el8_10 before *; from 2:8.2.2637-26.el9_8.10 before *)
- rhcos: no versions given (not affected: from 4.22.9.8.202608130832-0 before *)
- insights-proxy/insights-proxy-container-rhel9: no versions given (not affected: from 1786433656 before *)
- rhui5/cds-kubernetes-tp-rhel9: no versions given (not affected: from 1787241211 before *)
- rhui5/installer-tp-rhel9: no versions given (not affected: from 1787135742 before *)
- rhui5/rhua-tp-rhel9: no versions given (not affected: from 1787241260 before *)
- openshift/ose-rhel-coreos-8: no versions given

## Every score

- GitHub_M: CVSS:4.0 7.3 High `CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- redhat-SADP: CVSS:3.1 7.3 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c> (vendor-advisory)
- <https://github.com/vim/vim/commit/f08ab2f4d7d2947c8dd6c179ae08ee6146a2694b> (patch)
- <https://github.com/vim/vim/releases/tag/v9.2.0495> (product)
- <https://access.redhat.com/security/cve/CVE-2026-47162> (vdb-entry)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2487964> (issue-tracking)
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-47162.json>
- <https://access.redhat.com/errata/RHSA-2026:68711> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:54769> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:55431> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:38509> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:38510> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:38511> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:53371> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:58981> (vendor-advisory)

## Sources

- CVE List: [CVE-2026-47162](https://www.cve.org/CVERecord?id=CVE-2026-47162), CVE Terms of Use, modified 2026-09-18
- NVD: [CVE-2026-47162](https://nvd.nist.gov/vuln/detail/CVE-2026-47162), Public domain, modified 2026-09-18

---

Page: https://cve.day/CVE-2026-47162 · Whole record: https://cve.day/CVE-2026-47162.json · Rebuilt by cve.day 2026-11-25T22:59:24.454Z
