You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Security] MacVim affected by GHSA-66hr-7p6x-x5j3 — netrw NetrwMarkFile() code injection via crafted filename (vim < 9.2.0480) #1656
MacVim bundles the netrw plugin (runtime/pack/dist/opt/netrw/autoload/netrw.vim) which contains s:NetrwMarkFile() with a code injection vulnerability. When unmarking files from the global marked-file list, a filename is interpolated into a string expression passed to filter(), allowing a crafted filename containing a double quote " to break out of the quoted string and execute arbitrary Vimscript. The fix from vim 9.2.0480 (8af0f098c3a42a28661d0295364e6e0fd7dbc92c) has not been applied to macvim r183.
In s:NetrwMarkFile(), when a file is unmarked from the global marked-file list, dname (the full path derived from directory + filename) is interpolated directly into a filter() string expression:
" runtime/pack/dist/opt/netrw/autoload/netrw.vim line 5220 (macvim r183)callfilter(s:netrwmarkfilelist,'v:val != "'.dname.'"')
If dname contains a " character, the string literal breaks and arbitrary Vimscript executes inside filter(). For example, a file named:
x" . execute("silent! !touch /tmp/pwned") . "
generates:
callfilter(s:netrwmarkfilelist,'v:val != "x" . execute("silent! !touch /tmp/pwned") . ""')
which executes silent! !touch /tmp/pwned.
A second vulnerable call at line 7239 uses the same pattern:
Activity