exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

vim-tar.txt

vim-tar.txt
Posted Aug 8, 2008
Authored by Jan Minar

Vim versions below 7.2c.002 and above 7.0 suffer from a vulnerability that allows for potential arbitrary code execution when handling tar archives.

tags | advisory, arbitrary, code execution
SHA-256 | a9486b21729eee59d2a535ec6d0b54386cb2d2c87ea8c15b6e5de7aca2ccb936

vim-tar.txt

Change Mirror Download
Vim 7.2c.002 Fixes Arbitrary Command Execution when Handling Tar Archives

1. SUMMARY

Product : Vim -- Vi IMproved
Version : Vim >= 7.0 (possibly older), fixed in 7.2c.002
autoload/tar.vim version >= 9 (possibly older)
Impact : Arbitrary code execution
Wherefrom: Local, remote
Original : http://www.rdancer.org/vulnerablevim-tarplugin.v3.html

Vim update fixes a vulnerability that can lead to potential arbitrary
code execution when handling tar archives. The fnameescape() function
does not sanitize input properly, which renders code that uses it
vulnerable. Patch 7.2c.002 fixes the vulnerability.


2. BACKGROUND

``Vim is an almost compatible version of the UNIX editor Vi. Many new
features have been added: multi-level undo, syntax highlighting,
command line history, on-line help, spell checking, filename
completion, block operations, etc.''

-- Vim README.txt

``When one edits a *.tar file, this plugin will handle displaying a
contents page. Select a file to edit by moving the cursor atop
the desired file, then hit the <return> key. After editing, one may
also write to the file.''

-- Tar File Interface (pi_tar.txt)


3. VULNERABILITY

In statements such as the ones in ``$VIMRUNTIME/autoload/tar.vim'' on
lines 163, 308, 368, 407, and 419 (tar.vim version 20 (2008-07-30)):

163 exe "r ".fnameescape(a:tarfile)
308 exe "cd ".fnameescape(tmpdir)
368 exe "w! ".fnameescape(fname)
407 exe "e! ".fnameescape(tarfile)
419 exe "cd ".fnameescape(curdir)

fnameescape() makes the untrusted file name safe as an argument to
``execute''. However, the commands called by ``execute'' will in turn
each interpret the untrusted file name again. This can be still used
for arbitrary command execution. Another level of sanitizing/escaping
is needed in order to make the statements safe.


4. EXPLOIT

No exploit code is provided.


5. FIX

Fixed by patch 7.2c.002[2]: fnameescape() was updated to escape a
leading '+' and '>', and a single '-'.


6. REFERENCES

[1] Collection of Vulnerabilities in Fully Patched Vim 7.1
http://www.rdancer.org/vulnerablevim.html
[2] Patch 7.2c.002
http://groups.google.com/group/vim_dev/msg/80882b9ee9293139
http://ftp.vim.org/pub/vim/unstable/patches/7.2c/7.2c.002


7. COPYRIGHT

This advisory is Copyright 2008 Jan Minar <rdancer@rdancer.org>

Copying welcome, under the Creative Commons ``Attribution-Share Alike''
License http://creativecommons.org/licenses/by-sa/2.0/uk/

Code included herein, and accompanying this advisory, may be copied
according to the GNU General Public License version 2, or the Vim
license. See the subdirectory ``licenses''.

Various portions of the accompanying code were written by various
parties. Those parties may hold copyright, and those portions may be
copied according to their respective licenses.


8. HISTORY

2008-08-08 Sent to: <vim-dev@vim.org>,
<full-disclosure@lists.grok.org.uk>,
<bugtraq@securityfocus.com>
2008-08-08 Patch 7.2c.002 released, fixing the vulnerability
2008-08-06 Reported to Vim maintainer

Login or Register to add favorites

File Archive:

August 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    20 Files
  • 2
    Aug 2nd
    4 Files
  • 3
    Aug 3rd
    6 Files
  • 4
    Aug 4th
    55 Files
  • 5
    Aug 5th
    16 Files
  • 6
    Aug 6th
    0 Files
  • 7
    Aug 7th
    0 Files
  • 8
    Aug 8th
    13 Files
  • 9
    Aug 9th
    13 Files
  • 10
    Aug 10th
    34 Files
  • 11
    Aug 11th
    16 Files
  • 12
    Aug 12th
    5 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close