Bug 238259 - CVE-2007-2438 vim-7 modeline security issue
Summary: CVE-2007-2438 vim-7 modeline security issue
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: vim
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Karsten Hopp
QA Contact: David Lawrence
URL:
Whiteboard: impact=moderate,source=redhat,reporte...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-28 12:34 UTC by Karsten Hopp
Modified: 2012-09-05 15:39 UTC (History)
1 user (show)

Fixed In Version: RHSA-2007-0346
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-09 13:12:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2007:0346 0 normal SHIPPED_LIVE Moderate: vim security update 2007-05-09 13:12:00 UTC

Description Karsten Hopp 2007-04-28 12:34:44 UTC
Description of problem:
from the vim developer list:
> today somebody came to #vim, and pasted some modeline (containig joke or
> > such). He muttered something about not knowing what that means and left
> > before long. But (!) what I noticed is that feedkeys() was used as part of
> > foldexpression and it turned out that feedkeys() is allowed in sandbox,
> > which means malicious file can run arbitrary command via modeline like
> > this:
> > 
> > vim: fdm=expr fde=feedkeys("\\:!touch\ phantom_was_here\\<cr>")
> > 
> > I guess you can see the consequences. Is this known/intentional?

> That's pretty nasty.  I'll make a patch right away.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
  This comment is from Bram Moolenaar, the upstream VIM maintainer

This issue is already public. Exploitable only if someone manages to get any
user to open a malicious file with vim. Even worse if that user is root ;-(
This should be fixed as fast as possible.

Version-Release number of selected component (if applicable):
any vim versions >= 7.0    vim-6.3(RHEl-3/RHEL-4) doesn't have the feedkeys function

Comment 1 Karsten Hopp 2007-04-28 12:47:11 UTC
patch already available at 
http://marc.info/?l=vim-dev&m=117770531702496&w=2

Comment 2 Melissa Goldin 2007-04-29 19:42:11 UTC
*** Bug 230810 has been marked as a duplicate of this bug. ***

Comment 3 Karsten Hopp 2007-04-30 09:13:58 UTC
More issues have been found:
http://tech.groups.yahoo.com/group/vimdev/message/46658
Fix available at http://tech.groups.yahoo.com/group/vimdev/message/46667

Comment 12 Red Hat Bugzilla 2007-05-09 13:12:04 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2007-0346.html



Note You need to log in before you can comment on or make changes to this bug.