vim: patch security issue 9168/head
authorJan Pavlinec <jan.pavlinec@nic.cz>
Thu, 6 Jun 2019 13:53:19 +0000 (15:53 +0200)
committerJan Pavlinec <jan.pavlinec@nic.cz>
Thu, 6 Jun 2019 13:54:55 +0000 (15:54 +0200)
Fixes CVE-2019-12735

Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
utils/vim/Makefile
utils/vim/patches/003-CVE-2019-12735.patch [new file with mode: 0644]

index 03eeec84a9b04e3f1b2c79a3825e2eecfe721b61..1e1ec75fe235668623c78aa3c109e43d0716ad08 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vim
 PKG_VERSION:=8.1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 VIMVER:=81
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/utils/vim/patches/003-CVE-2019-12735.patch b/utils/vim/patches/003-CVE-2019-12735.patch
new file mode 100644 (file)
index 0000000..bf29ce9
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/src/getchar.c
++++ b/src/getchar.c
+@@ -1407,6 +1407,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? */