Karsten Hopp c020e7
To: vim-dev@vim.org
Karsten Hopp c020e7
Subject: patch 7.0.234
Karsten Hopp c020e7
Fcc: outbox
Karsten Hopp c020e7
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c020e7
Mime-Version: 1.0
Karsten Hopp c020e7
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp c020e7
Content-Transfer-Encoding: 8bit
Karsten Hopp c020e7
------------
Karsten Hopp c020e7
Karsten Hopp c020e7
Patch 7.0.234
Karsten Hopp c020e7
Problem:    It's possible to use feedkeys() from a modeline.  That is a
Karsten Hopp c020e7
	    security issue, can be used for a trojan horse.
Karsten Hopp c020e7
Solution:   Disallow using feedkeys() in the sandbox.
Karsten Hopp c020e7
Files:	    src/eval.c
Karsten Hopp c020e7
Karsten Hopp c020e7
Karsten Hopp c020e7
*** ../vim-7.0.233/src/eval.c	Thu Apr 26 17:08:16 2007
Karsten Hopp c020e7
--- src/eval.c	Fri Apr 27 21:48:18 2007
Karsten Hopp c020e7
***************
Karsten Hopp c020e7
*** 9078,9083 ****
Karsten Hopp c020e7
--- 9078,9089 ----
Karsten Hopp c020e7
      int		typed = FALSE;
Karsten Hopp c020e7
      char_u	*keys_esc;
Karsten Hopp c020e7
  
Karsten Hopp c020e7
+     /* This is not allowed in the sandbox.  If the commands would still be
Karsten Hopp c020e7
+      * executed in the sandbox it would be OK, but it probably happens later,
Karsten Hopp c020e7
+      * when "sandbox" is no longer set. */
Karsten Hopp c020e7
+     if (check_secure())
Karsten Hopp c020e7
+ 	return;
Karsten Hopp c020e7
+ 
Karsten Hopp c020e7
      rettv->vval.v_number = 0;
Karsten Hopp c020e7
      keys = get_tv_string(&argvars[0]);
Karsten Hopp c020e7
      if (*keys != NUL)
Karsten Hopp c020e7
*** ../vim-7.0.233/src/version.c	Thu Apr 26 18:42:17 2007
Karsten Hopp c020e7
--- src/version.c	Fri Apr 27 22:13:23 2007
Karsten Hopp c020e7
***************
Karsten Hopp c020e7
*** 668,669 ****
Karsten Hopp c020e7
--- 668,671 ----
Karsten Hopp c020e7
  {   /* Add new patch number below this line */
Karsten Hopp c020e7
+ /**/
Karsten Hopp c020e7
+     234,
Karsten Hopp c020e7
  /**/
Karsten Hopp c020e7
Karsten Hopp c020e7
-- 
Karsten Hopp c020e7
"Making it up?  Why should I want to make anything up?  Life's bad enough
Karsten Hopp c020e7
as it is without wanting to invent any more of it."
Karsten Hopp c020e7
		-- Marvin, the Paranoid Android in Douglas Adams'
Karsten Hopp c020e7
		   "The Hitchhiker's Guide to the Galaxy"
Karsten Hopp c020e7
Karsten Hopp c020e7
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c020e7
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c020e7
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp c020e7
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///