Cloudanix VulnDB

CVE-2017-17087

Medium · 5.5

CVSS

5.5

EPSS

0.4%

Published

Dec 1, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A text editor on Unix-like systems could accidentally let other users on the same computer read copies of important files like password lists.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Low
Impact
Data Exposure
Component
Application
Class
Information Disclosure
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

In Vim versions before 8.0.1263, when creating a swap file (.swp), the group ownership is set to the editor's primary group instead of preserving the original file's group ownership. This can expose sensitive files' contents to unintended group members if permissions allow read access.

Why it matters to the business

Local users with group membership matching the editor's primary group may gain unauthorized access to sensitive information, such as password files, potentially leading to privilege escalation or data breaches on shared systems.

How an attack unfolds

An attacker with local access edits a sensitive file using Vim as a user whose primary group differs from the file's group. The resulting swap file inherits the editor's group, allowing the attacker to read the swap file's contents which mirror the sensitive data.

How to fix it

Upgrade Vim to a version containing commit 5a73e0ca54c77e067c3b12ea6f35e3e8681e8cf8 or later. Ensure swap files are created with appropriate group ownership or disable swap files for sensitive operations.

How to confirm the fix worked

Verify Vim version is 8.0.1263 or higher. Test by editing a file with group ownership different from the user's primary group and checking the .swp file's group.

Typical attack path

  1. Gain local user access on the system
  2. Identify sensitive files with restrictive group permissions
  3. Edit the file using Vim under a user with a different primary group
  4. Access the .swp file to read the sensitive content

How to detect it

Examine system logs for Vim usage on sensitive files and check for .swp files with unexpected group ownership in directories containing critical files.

What your security team should do

  • Update Vim installations to the fixed version immediately
  • Review and restrict local access to systems handling sensitive files
  • Consider using alternative editors or configurations that preserve file ownership for administrative tasks

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 vim 0 2:8.0.1401-1
Debian:12 vim 0 2:8.0.1401-1
Debian:13 vim 0 2:8.0.1401-1
Debian:8 vim 0 2:7.4.488-7+deb8u4
Debian:9 vim 0 2:8.0.0197-4+deb9u4
SUSE:Enterprise Storage 6 vim 0 8.2.5038-150000.5.21.1
SUSE:Enterprise Storage 7 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise High Performance Computing 15-ESPOS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise High Performance Computing 15-LTSS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Micro 5.1 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Micro 5.2 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Module for Basesystem 15 SP4 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Module for Desktop Applications 15 SP4 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server 12 SP2-BCL vim 0 9.0.0814-17.9.1
SUSE:Linux Enterprise Server 12 SP3-BCL vim 0 9.0.0814-17.9.1
SUSE:Linux Enterprise Server 12 SP4-LTSS vim 0 9.0.0814-17.9.1
SUSE:Linux Enterprise Server 12 SP5 vim 0 9.0.0814-17.9.1
SUSE:Linux Enterprise Server 15 SP1-BCL vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server 15 SP1-LTSS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server 15 SP2-BCL vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server 15 SP2-LTSS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server 15-LTSS vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP4 vim 0 9.0.0814-17.9.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 vim 0 9.0.0814-17.9.1
SUSE:Linux Enterprise Server for SAP Applications 15 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 vim 0 8.2.5038-150000.5.21.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 vim 0 8.2.5038-150000.5.21.1
SUSE:Manager Proxy 4.1 vim 0 8.2.5038-150000.5.21.1
SUSE:Manager Retail Branch Server 4.1 vim 0 8.2.5038-150000.5.21.1
SUSE:Manager Server 4.1 vim 0 8.2.5038-150000.5.21.1
SUSE:OpenStack Cloud 9 vim 0 9.0.0814-17.9.1
SUSE:OpenStack Cloud Crowbar 9 vim 0 9.0.0814-17.9.1
Ubuntu:16.04:LTS vim 0 2:7.4.1689-3ubuntu1.5
Ubuntu:18.04:LTS vim 0 2:8.0.1453-1ubuntu1
Ubuntu:18.04:LTS vim 0 2:8.0.1453-1ubuntu1.7
Ubuntu:18.04:LTS vim 0 2:8.0.1453-1ubuntu1.4
Ubuntu:20.04:LTS vim 0 2:8.1.2269-1ubuntu5.4
Ubuntu:Pro:14.04:LTS vim 0 2:7.4.052-1ubuntu3.1+esm4
Ubuntu:Pro:16.04:LTS vim 0 2:7.4.1689-3ubuntu1.5+esm3
openSUSE:Leap 15.3 vim 0 8.2.5038-150000.5.21.1
openSUSE:Leap 15.4 vim 0 8.2.5038-150000.5.21.1

Related vulnerabilities