From 5cbfe1fa5557172d8168f52d49d74b372046edf4 Mon Sep 17 00:00:00 2001 From: edyfox Date: Sat, 28 Apr 2007 01:45:54 +0000 Subject: [PATCH] Patch 7.0.234 Problem: It's possible to use feedkeys() from a modeline. That is a security issue, can be used for a trojan horse. Solution: Disallow using feedkeys() in the sandbox. Files: src/eval.c git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/vim7@252 2a77ed30-b011-0410-a7ad-c7884a0aa172 --- src/eval.c | 6 ++++++ src/version.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/eval.c b/src/eval.c index 7a5ca1d6..cfb34761 100644 --- a/src/eval.c +++ b/src/eval.c @@ -9078,6 +9078,12 @@ f_feedkeys(argvars, rettv) int typed = FALSE; char_u *keys_esc; + /* This is not allowed in the sandbox. If the commands would still be + * executed in the sandbox it would be OK, but it probably happens later, + * when "sandbox" is no longer set. */ + if (check_secure()) + return; + rettv->vval.v_number = 0; keys = get_tv_string(&argvars[0]); if (*keys != NUL) diff --git a/src/version.c b/src/version.c index 7f7e75f3..7fe531d9 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 234, +/**/ 233, /**/ 232, -- 2.11.4.GIT