diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-11-01 16:21:16 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-11-26 18:53:10 +0000 |
commit | 38a831e54a7261fda06555bc7464546ecfcbf897 (patch) | |
tree | c44a94badd3d4b7c5c71f94f167e49b9f23e6eeb /src | |
parent | 39776d1a6513e33a33addb69deae72ab2ecafef4 (diff) | |
download | rneovim-38a831e54a7261fda06555bc7464546ecfcbf897.tar.gz rneovim-38a831e54a7261fda06555bc7464546ecfcbf897.tar.bz2 rneovim-38a831e54a7261fda06555bc7464546ecfcbf897.zip |
vim-patch:7.4.1777
Problem: Newly added features can escape the sandbox.
Solution: Add checks for restricted and secure. (Yasuhiro Matsumoto)
https://github.com/vim/vim/commit/3849992b16011e36a5cb5be4b127f843389b96fd
timer_start is missing check_secure.
The timer callback can, for example, call a function defined from outside the sandbox that does
stuff that would be disallowed from inside the sandbox. This is usually not allowed.
Cherry-pick eval.txt change from:
https://github.com/vim/vim/commit/68e6560b84f196c82e27a72669684d5506a3a837
Required for v8.1.2013.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/funcs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index dfadd28ebe..33ca4016cf 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -11551,6 +11551,9 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr) dict_T *dict; rettv->vval.v_number = -1; + if (check_secure()) { + return; + } if (argvars[2].v_type != VAR_UNKNOWN) { if (argvars[2].v_type != VAR_DICT |