Cloudanix VulnDB

CVE-2017-16879

High · 7.8

CVSS

7.8

EPSS

2.4%

Published

Nov 22, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in a common terminal-handling library can let a specially made file crash programs or take over the computer if it is processed.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Full Compromise
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Stack-based buffer overflow in the _nc_write_entry function in ncurses allows an attacker-supplied terminfo file to corrupt memory, leading to application crash or arbitrary code execution.

Why it matters to the business

Systems relying on affected packages may experience service disruption or full host compromise when processing untrusted terminfo data; high downstream package prevalence increases exposure surface across containerized environments.

How an attack unfolds

An attacker crafts a malicious terminfo file that overflows the stack buffer during entry writing; the file is fed to tools such as tic or any application linked against ncurses that parses terminfo, resulting in denial of service or code execution.

How to fix it

Upgrade all listed packages to the fixed versions provided (0.7.1-r1 or newer) and rebuild any dependent container images; remove or replace older ncurses packages from build and runtime environments.

How to confirm the fix worked

Verify installed package versions match the fixed releases; scan container images for the presence of vulnerable ncurses libraries; confirm terminfo parsing tools no longer crash on test malformed files.

Typical attack path

  1. Identify an application or build process that invokes ncurses terminfo parsing
  2. Craft a terminfo source file containing oversized entries targeting the _nc_write_entry buffer
  3. Deliver the file via local filesystem access or supply chain artifact
  4. Trigger parsing with tic or the vulnerable application
  5. Achieve crash or gain control of execution flow

How to detect it

Search application and build logs for crashes or abnormal terminfo processing; inspect process memory dumps for signs of stack corruption during terminfo handling; monitor for unexpected execution of tic or similar utilities on untrusted inputs.

What your security team should do

  • Prioritize patching of all affected sigstore-scaffolding packages within 30 days given the memory corruption impact
  • Add ncurses version checks to CI/CD pipelines to prevent reintroduction of vulnerable builds
  • Review build processes that consume external terminfo files and enforce strict input validation

The record

Stack-based buffer overflow in the _nc_write_entry function in tinfo/write_entry.c in ncurses 6.0 allows attackers to cause a denial of service (application crash) or possibly execute arbitrary code via a crafted terminfo file, as demonstrated by tic.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.10 ncurses 0 6.0_p20171125-r0
Alpine:v3.11 ncurses 0 6.0_p20171125-r0
Alpine:v3.12 ncurses 0 6.0_p20171125-r0
Alpine:v3.13 ncurses 0 6.0_p20171125-r0
Alpine:v3.14 ncurses 0 6.0_p20171125-r0
Alpine:v3.15 ncurses 0 6.0_p20171125-r0
Alpine:v3.16 ncurses 0 6.0_p20171125-r0
Alpine:v3.17 ncurses 0 6.0_p20171125-r0
Alpine:v3.18 ncurses 0 6.0_p20171125-r0
Alpine:v3.19 ncurses 0 6.0_p20171125-r0
Alpine:v3.20 ncurses 0 6.0_p20171125-r0
Alpine:v3.21 ncurses 0 6.0_p20171125-r0
Alpine:v3.22 ncurses 0 6.0_p20171125-r0
Alpine:v3.4 ncurses 0 6.0_p20171125-r0
Alpine:v3.5 ncurses 0 6.0_p20171125-r0
Alpine:v3.6 ncurses 0 6.0_p20171125-r0
Alpine:v3.7 ncurses 0 6.0_p20171125-r0
Alpine:v3.8 ncurses 0 6.0_p20171125-r0
Alpine:v3.9 ncurses 0 6.0_p20171125-r0
Debian:11 ncurses 0 6.0+20171125-1
Debian:12 ncurses 0 6.0+20171125-1
Debian:13 ncurses 0 6.0+20171125-1
Debian:14 ncurses 0 6.0+20171125-1
Mageia:6 ncurses 0 6.0-8.1.mga6
SUSE:Linux Enterprise Server 11 SP4 ncurses 0 5.6-93.12.1
SUSE:Linux Enterprise Server for SAP Applications 11 SP4 ncurses 0 5.6-93.12.1
SUSE:Linux Enterprise Software Development Kit 11 SP4 ncurses 0 5.6-93.12.1
Ubuntu:18.04:LTS ncurses 0 6.1-1ubuntu1.18.04
Ubuntu:Pro:14.04:LTS ncurses 0 5.9+20140118-1ubuntu1+esm2
Ubuntu:Pro:16.04:LTS ncurses 0 6.0+20160213-1ubuntu1+esm2

Related vulnerabilities