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:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close