安全研究

安全漏洞
Netrw Vim脚本s:BrowserMaps()函数命令执行漏洞

发布日期:2008-07-16
更新日期:2008-07-18

受影响系统:
Dr Chip netrw 127
描述:
BUGTRAQ  ID: 30254

Netrw是一款VIM支持的远程读写文件的插件。

Netrw脚本的netrw.vim文件中没有正确地过滤某些语句:

    $ grep -n exe ~/.vim/autoload/netrw.vim|grep -v -e escape -e Decho -e
executable | wc -l
    239

当用户打开目录时,会使用execute命令加载键盘映射字符串,但没有过滤容纳当前目录名的b:netrw_curdir变量。在s:BrowserMaps()函数中:

        1709    if s:didstarstar || !mapcheck("<s-up>","n")
        1710     nnoremap <buffer> <silent> <s-up>   :Pexplore<cr>
        1711    endif
        1712    if g:netrw_mousemaps == 1
        1713     nnoremap <buffer> <silent> <leftmouse>   <leftmouse>:call <SID>NetrwLeftmouse(1)<cr>
        1714     nnoremap <buffer> <silent> <middlemouse> <leftmouse>:call <SID>NetrwPrevWinOpen(1)<cr>
        1715     nnoremap <buffer> <silent> <s-leftmouse> <leftmouse>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
   -->  1716     exe 'nnoremap <buffer> <silent> <rightmouse>  <leftmouse>:call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
   -->  1717     exe 'vnoremap <buffer> <silent> <rightmouse>  <leftmouse>:call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
        1718    endif
   -->  1719    exe 'nnoremap <buffer> <silent> <del>        :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
   -->  1720    exe 'vnoremap <buffer> <silent> <del>        :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
   -->  1721    exe 'nnoremap <buffer> <silent> D            :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
   -->  1722    exe 'vnoremap <buffer> <silent> D            :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
   -->  1723    exe 'nnoremap <buffer> <silent> R            :call <SID>NetrwLocalRename("'.b:netrw_curdir.'")<cr>'
   -->  1724    exe 'vnoremap <buffer> <silent> R            :call <SID>NetrwLocalRename("'.b:netrw_curdir.'")<cr>'
   -->  1725    exe 'nnoremap <buffer> <silent> <Leader>m    :call <SID>NetrwMakeDir("")<cr>'
        1726    nnoremap <buffer> <F1>               :he netrw-quickhelp<cr>

因此如果用户受骗打开了带有特制文件名的目录的话,就可能导致执行任意代码。

<*来源:Jan Minar (jjminar@foo.fastmail.bar.fm
  
  链接:http://marc.info/?l=bugtraq&m=121622370502654&w=2
*>

建议:
厂商补丁:

Dr Chip
-------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://mysite.verizon.net/astronaut/index.html

浏览次数:3054
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障