mirror of
https://github.com/neovim/neovim.git
synced 2026-06-18 17:51:18 +00:00
fix(vim.secure): read() command injection vulnerability #39918
Problem:
Malicious filename can execute code because of ":" cmdline expansion.
Solution:
Use `fnameescape()`.
fix https://github.com/neovim/neovim/issues/39914
(cherry picked from commit 799cbfff85)
This commit is contained in:
committed by
github-actions[bot]
parent
17ddfde131
commit
f83e0dcaf8
@@ -150,7 +150,7 @@ function M.read(path)
|
||||
return nil
|
||||
elseif result == 2 then
|
||||
-- View
|
||||
vim.cmd('sview ' .. fullpath)
|
||||
vim.cmd(('sview %s'):format(vim.fn.fnameescape(fullpath)))
|
||||
return nil
|
||||
elseif result == 3 then
|
||||
-- Deny
|
||||
|
||||
Reference in New Issue
Block a user