Cloudanix VulnDB

CVE-2017-5953

Critical · 9.8

CVSS

9.8

EPSS

2.8%

Published

Feb 10, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in the vim editor could let attackers take over a computer when a user opens a specially crafted spelling file.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Remote Code Execution
Component
Application
Class
Buffer Overflow
Remediation
Patch
Effort
Low
Patch risk
Low

What it actually does

Integer overflow during validation of tree length values in spell files leads to undersized memory allocation followed by a buffer overflow in vim.

Why it matters to the business

Attackers could gain control of developer workstations or build systems by supplying malicious spell files, risking source code theft or insertion of backdoors in software projects that rely on vim.

How an attack unfolds

An attacker prepares a crafted spell file containing an oversized or malformed tree length value; when a victim opens the file with an unpatched vim instance the flawed length check triggers an integer overflow, resulting in a heap buffer overflow that can be leveraged for arbitrary code execution.

How to fix it

Upgrade vim to the commit 399c297aa93afe2c0a39e2a1b3f972aebba44c9d or later; rebuild from source or obtain updated packages from distribution maintainers.

How to confirm the fix worked

Confirm vim binary reports a version containing commit 399c297aa93afe2c0a39e2a1b3f972aebba44c9d; test with known-good and malformed spell files to verify allocation behavior.

Typical attack path

  1. Prepare malicious spell file with manipulated tree length
  2. Deliver file via email, repository, or shared storage
  3. Victim opens file in vulnerable vim
  4. Integer overflow occurs during allocation
  5. Buffer overflow allows shellcode execution

How to detect it

Review system and application logs for vim invocations involving spell files; inspect core dumps or crash reports showing abnormal memory allocation sizes near spell-file parsing routines.

What your security team should do

  • Immediately update all vim installations to the fixed commit
  • Scan source repositories and developer images for the vulnerable version
  • Restrict loading of untrusted spell files through vim configuration
  • Monitor EPSS and exploit maturity for any future increase in risk

The record

vim before patch 8.0.0322 does not properly validate values for tree length when handling a spell file, which may result in an integer overflow at a memory allocation site and a resultant buffer overflow.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.10 vim 0 8.0.0329-r0
Alpine:v3.11 vim 0 8.0.0329-r0
Alpine:v3.12 vim 0 8.0.0329-r0
Alpine:v3.13 vim 0 8.0.0329-r0
Alpine:v3.14 vim 0 8.0.0329-r0
Alpine:v3.15 vim 0 8.0.0329-r0
Alpine:v3.16 vim 0 8.0.0329-r0
Alpine:v3.17 vim 0 8.0.0329-r0
Alpine:v3.18 vim 0 8.0.0329-r0
Alpine:v3.19 vim 0 8.0.0329-r0
Alpine:v3.2 vim 0 7.4.712-r2
Alpine:v3.20 vim 0 8.0.0329-r0
Alpine:v3.21 vim 0 8.0.0329-r0
Alpine:v3.22 vim 0 8.0.0329-r0
Alpine:v3.3 vim 0 7.4.943-r5
Alpine:v3.4 vim 0 7.4.1831-r3
Alpine:v3.5 vim 0 8.0.0329-r0
Alpine:v3.6 vim 0 8.0.0329-r0
Alpine:v3.7 vim 0 8.0.0329-r0
Alpine:v3.8 vim 0 8.0.0329-r0
Alpine:v3.9 vim 0 8.0.0329-r0
Debian:11 neovim 0 0.1.7-4
Debian:11 vim 0 2:8.0.0197-2
Debian:12 neovim 0 0.1.7-4
Debian:12 vim 0 2:8.0.0197-2
Debian:13 neovim 0 0.1.7-4
Debian:13 vim 0 2:8.0.0197-2
Debian:7 vim 0 2:7.3.547-7+deb7u2
Debian:8 vim 0 2:7.4.488-7+deb8u2
Mageia:5 vim 0 7.4.430-7.1.mga5
SUSE:Linux Enterprise Desktop 12 SP2 vim 0 7.4.326-16.1
SUSE:Linux Enterprise Server 11 SP4 vim 0 7.2-8.20.8
SUSE:Linux Enterprise Server 12 SP2 vim 0 7.4.326-16.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 for Raspberry Pi 12 SP2 vim 0 7.4.326-16.1
SUSE:Linux Enterprise Server for SAP Applications 11 SP4 vim 0 7.2-8.20.8
SUSE:Linux Enterprise Server for SAP Applications 12 SP2 vim 0 7.4.326-16.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: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:14.04:LTS vim 0 2:7.4.052-1ubuntu3.1+esm1
Ubuntu:16.04:LTS vim 0 2:7.4.1689-3ubuntu1.3
Ubuntu:16.04:LTS vim 0 2:7.4.1689-3ubuntu1.4
Ubuntu:18.04:LTS neovim 0 0.2.2-3
Ubuntu:18.04:LTS vim 0 2:8.0.1144-1ubuntu1
Ubuntu:18.04:LTS vim 0 2:8.0.1453-1ubuntu1.1
Ubuntu:18.04:LTS vim 0 2:8.0.1453-1ubuntu1.3
Ubuntu:Pro:14.04:LTS vim 0 2:7.4.052-1ubuntu3.1+esm1
openSUSE:Tumbleweed neovim 0 0.5.1-1.1
openSUSE:Tumbleweed vim 0 8.2.3408-1.2

Related vulnerabilities