Bug 1398227 (CVE-2016-1248) - CVE-2016-1248 vim: Lack of validation of values for few options results in code exection
Summary: CVE-2016-1248 vim: Lack of validation of values for few options results in co...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2016-1248
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1398228 1399008 1399009 1399010 1399011
Blocks: 1398230
TreeView+ depends on / blocked
 
Reported: 2016-11-24 10:15 UTC by Andrej Nemec
Modified: 2021-02-17 02:59 UTC (History)
8 users (show)

Fixed In Version: vim 8.0.0056
Doc Type: If docs needed, set a value
Doc Text:
A vulnerability was found in vim in how certain modeline options were treated. An attacker could craft a file that, when opened in vim with modelines enabled, could execute arbitrary commands with privileges of the user running vim.
Clone Of:
Environment:
Last Closed: 2016-12-22 00:43:00 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2972 0 normal SHIPPED_LIVE Moderate: vim security update 2016-12-21 07:08:53 UTC

Description Andrej Nemec 2016-11-24 10:15:02 UTC
A vulnerability was found in Vim which would allow arbitrary shell commands to be run if a user opened a file with a malicious modeline.  This is due to lack of validation of values for a few options.  Those options' values are then used in Vim's scripts to build a command string that's evaluated by :execute, which is what allows the shell commands to be run.

Upstream patch:

https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a

References:

http://seclists.org/oss-sec/2016/q4/506

Comment 1 Andrej Nemec 2016-11-24 10:15:30 UTC
Created vim tracking bugs for this issue:

Affects: fedora-all [bug 1398228]

Comment 2 Doran Moppert 2016-11-28 03:19:29 UTC
Mitigation:

Disabling modeline support in .vimrc by adding "set nomodeline" will prevent exploitation of this flaw. By default, modeline is enabled for ordinary users but disabled for root.

Comment 10 errata-xmlrpc 2016-12-21 02:09:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6
  Red Hat Enterprise Linux 7

Via RHSA-2016:2972 https://rhn.redhat.com/errata/RHSA-2016-2972.html


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