mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
patch 9.2.0299: runtime(zip): may write using absolute paths
Problem: runtime(zip): may write using absolute paths
(syndicate)
Solution: Detect this case and abort on Unix, warn in the documentation
about possible issues
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Binary file not shown.
@@ -296,3 +296,22 @@ def g:Test_zip_fname_evil_path2()
|
||||
assert_match('zipfile://.*::.*tmp/foobar', @%)
|
||||
bw!
|
||||
enddef
|
||||
|
||||
def g:Test_zip_fname_evil_path3()
|
||||
CheckNotMSWindows
|
||||
# needed for writing the zip file
|
||||
CheckExecutable zip
|
||||
|
||||
CopyZipFile("evil.zip")
|
||||
defer delete("X.zip")
|
||||
e X.zip
|
||||
|
||||
:1
|
||||
var fname = 'payload.txt'
|
||||
search('\V' .. fname)
|
||||
exe "normal \<cr>"
|
||||
:w!
|
||||
var mess = execute(':mess')
|
||||
assert_match('Path Traversal Attack', mess)
|
||||
bw!
|
||||
enddef
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
299,
|
||||
/**/
|
||||
298,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user