{"id":"CVE-2026-47162","aliases":["CVE-2026-47162"],"related":[],"kind":"vulnerability","state":"published","title":"Vim: Vimscript Code Injection in netrw NetrwBookHistSave() via crafted directory name","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"}],"published":"2026-06-11T18:32:14.471Z","modified":"2026-09-18T13:18:28.190Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.3,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","score":7.3,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-74","CWE-94","CWE-140"],"affected":[{"ranges":[{"version":"< 9.2.0495","status":"affected"}],"vendor":"vim","product":"vim","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"2:9.1.083-9.el10_2.7","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","package":"vim","cpe":"cpe:/o:redhat:enterprise_linux:10.2","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"2:9.1.083-5.el10_0.4","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10.0 Extended Update Support","package":"vim","cpe":"cpe:/o:redhat:enterprise_linux_eus:10.0","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"2:7.4.629-8.el7_9.2","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 7 Extended Lifecycle Support","package":"vim","cpe":"cpe:/o:redhat:rhel_els:7","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"2:8.0.1763-27.el8_10","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","package":"vim","cpe":"cpe:/a:redhat:enterprise_linux:8","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"2:8.2.2637-26.el9_8.10","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","package":"vim","cpe":"cpe:/a:redhat:enterprise_linux:9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"4.22.9.8.202608130832-0","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.22","package":"rhcos","cpe":"cpe:/a:redhat:openshift:4.22::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1786433656","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Insights proxy 1.5","package":"insights-proxy/insights-proxy-container-rhel9","cpe":"cpe:/a:redhat:insights_proxy:1.5::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787241211","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Update Infrastructure 5","package":"rhui5/cds-kubernetes-tp-rhel9","cpe":"cpe:/a:redhat:rhui:5::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787135742","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Update Infrastructure 5","package":"rhui5/installer-tp-rhel9","cpe":"cpe:/a:redhat:rhui:5::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787241260","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Update Infrastructure 5","package":"rhui5/rhua-tp-rhel9","cpe":"cpe:/a:redhat:rhui:5::el9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 6","package":"vim","cpe":"cpe:/o:redhat:enterprise_linux:6","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Hardened Images","package":"vim","cpe":"cpe:/a:redhat:hummingbird:1","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4","package":"openshift/ose-rhel-coreos-8","cpe":"cpe:/a:redhat:openshift:4","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"9.2.0495"}],"vendor":"vim","product":"vim","cpe":"cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c","tags":["vendor-advisory","x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/vim/vim/commit/f08ab2f4d7d2947c8dd6c179ae08ee6146a2694b","tags":["patch","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/vim/vim/releases/tag/v9.2.0495","tags":["product","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-47162","tags":["vdb-entry","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2487964","tags":["issue-tracking","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-47162.json","tags":["x-sadp-csaf-vex"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:68711","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:54769","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:55431","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:38509","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:38510","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:38511","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:53371","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:58981","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-06-12T03:55:42.649Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47162","url":"https://www.cve.org/CVERecord?id=CVE-2026-47162","licence":"CVE Terms of Use","modified":"2026-09-18T12:04:49.575Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47162","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47162","licence":"Public domain","modified":"2026-09-18T13:18:28.190Z"}],"updatedAt":"2026-11-25T22:59:24.454Z","epss":{"score":0.00275,"percentile":0.21307,"date":"2026-12-01T12:00:22.000Z"}}