--- a/src/getchar.c 2018-10-03 04:24:53.000000000 -0400 +++ b/src/getchar_1.c 2019-06-18 23:02:45.377000000 -0400 @@ -1433,6 +1433,12 @@ openscript( EMSG(_(e_nesting)); return; } + + // Disallow sourcing a file in the sandbox, the commands would be executed + // later, possibly outside of the sandbox. + if (check_secure()) + return; + #ifdef FEAT_EVAL if (ignore_script) /* Not reading from script, also don't open one. Warning message? */