Bug 1398227 (CVE-2016-1248)

Summary: CVE-2016-1248 vim: Lack of validation of values for few options results in code exection
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: anemec, dmoppert, gchamoul, karsten, moshima.web, sardella, slawomir, zdohnal
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-22 00:43:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1398228, 1399008, 1399009, 1399010, 1399011    
Bug Blocks: 1398230    

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