Bug 1524485 (CVE-2017-17087)

Summary: CVE-2017-17087 vim: Sets the group ownership of a .swp file to the editor's primary group
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: gchamoul, karsten, zdohnal
Target Milestone: ---Keywords: Reopened, Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: vim 8.0.1263 Doc Type: If docs needed, set a value
Doc Text:
It was found that the swap file created by vim when opening a file was using the user's primary group instead of the file's group. An attacker belonging to the victim's primary group could use this flaw to read the vim swap file.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-02 17:36:33 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: 1524489    
Bug Blocks: 1508790    

Description Andrej Nemec 2017-12-11 15:33:58 UTC
fileio.c in Vim prior to 8.0.1263 sets the group ownership of a .swp file to the editor's primary group (which may be different from the group ownership of the original file), which allows local users to obtain sensitive information by leveraging an applicable group membership, as demonstrated by /etc/shadow owned by root:shadow mode 0640, but /etc/.shadow.swp owned by root:users mode 0640, a different vulnerability than CVE-2017-1000382.

References:

http://openwall.com/lists/oss-security/2017/11/27/2
https://groups.google.com/forum/#!msg/vim_dev/sRT9BtjLWMk/BRtSXNU4BwAJ

Upstream patch:

https://github.com/vim/vim/commit/5a73e0ca54c77e067c3b12ea6f35e3e8681e8cf8

Comment 1 Andrej Nemec 2017-12-11 15:35:17 UTC
Created vim tracking bugs for this issue:

Affects: fedora-26 [bug 1524489]

Comment 4 Cedric Buissart 2018-01-02 17:31:04 UTC
In Red Hat Enterprise Linux, the default primary group is unique to the user (e.g.: root's primary group is root, user1's primary group will be user1, etc.).
Thus unless default primary group is modified at creation time, or at execution time (e.g. via newgrp or sg), this vulnerability will not be effective.

Comment 5 Cedric Buissart 2018-01-02 17:32:08 UTC
Statement:

Red Hat Product Security has rated this issue as having Low security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.