{"document":{"category":"csaf_vex","csaf_version":"2.0","title":"CVE-2026-47162: Vim: Vimscript Code Injection in netrw NetrwBookHistSave() via crafted directory name","publisher":{"category":"vendor","name":"HarborGuard Database","namespace":"https://database.harborguard.co"},"tracking":{"id":"CVE-2026-47162","status":"final","version":"1","initial_release_date":"2026-06-11T18:32:14.471Z","current_release_date":"2026-06-12T12:47:52.867Z","revision_history":[{"date":"2026-06-11T18:32:14.471Z","number":"1","summary":"Initial machine-readable export from HarborGuard."}]},"distribution":{"tlp":{"label":"WHITE"},"text":"Public CVE data; freely redistributable."},"notes":[{"category":"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.","title":"CVE description"}],"references":[{"category":"self","summary":"CVE-2026-47162 on HarborGuard Database","url":"https://database.harborguard.co/cve/CVE-2026-47162"},{"category":"external","summary":"CVE Record","url":"https://www.cve.org/CVERecord?id=CVE-2026-47162"},{"category":"external","summary":"https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c","url":"https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c"},{"category":"external","summary":"https://github.com/vim/vim/commit/f08ab2f4d7d2947c8dd6c179ae08ee6146a2694b","url":"https://github.com/vim/vim/commit/f08ab2f4d7d2947c8dd6c179ae08ee6146a2694b"},{"category":"external","summary":"https://github.com/vim/vim/releases/tag/v9.2.0495","url":"https://github.com/vim/vim/releases/tag/v9.2.0495"}]},"product_tree":{"branches":[{"category":"vendor","name":"vim","branches":[{"category":"product_name","name":"vim","branches":[{"category":"product_version","name":"< 9.2.0495","product":{"name":"vim vim < 9.2.0495","product_id":"CSAFPID-1","product_identification_helper":{"cpe":"cpe:2.3:a:vim:vim:\\<_9.2.0495:*:*:*:*:*:*:*"}}}]}]}]},"vulnerabilities":[{"cve":"CVE-2026-47162","title":"Vim: Vimscript Code Injection in netrw NetrwBookHistSave() via crafted directory name","notes":[{"category":"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.","title":"CVE description"}],"product_status":{"known_affected":["CSAFPID-1"]},"scores":[{"cvss_v4":{"version":"4.0","vectorString":"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","baseScore":7.3,"baseSeverity":"HIGH"},"products":["CSAFPID-1"]}],"remediations":[{"category":"none_available","details":"No fixed version is published yet. Monitor the upstream advisory.","product_ids":["CSAFPID-1"]}]}]}