CVE-2017-16879
High · 7.8CVSS
7.8
EPSS
2.4%
Published
Nov 22, 2017
CISA due date
—
Cloudanix analysis
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
- Identify an application or build process that invokes ncurses terminfo parsing
- Craft a terminfo source file containing oversized entries targeting the _nc_write_entry buffer
- Deliver the file via local filesystem access or supply chain artifact
- Trigger parsing with tic or the vulnerable application
- 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
- CVE-2017-10684 In ncurses 6.0, there is a stack-based buffer overflow in the fmt_entry function. Also affects ncurses
- CVE-2023-45918 ncurses 6.4-20230610 has a NULL pointer dereference in tgetstr in tinfo/lib_termcap.c. Also affects ncurses
- CVE-2023-50495 NCurse v6.4-20230418 was discovered to contain a segmentation fault via the component… Also affects ncurses
- CVE-2026-111497 A buffer overflow vulnerability in the Brotli decoder (c/dec/decode.c) in Google Brotli… CWE-787
- CVE-2026-112397 Pillow is a Python imaging library. CWE-787
- CVE-2026-112059 libLAS through 1.8.1 contains a heap out-of-bounds write vulnerability in the point… CWE-787
- CVE-2026-89088 A flaw was found in parted. CWE-787
- CVE-2026-89085 A flaw was found in parted. CWE-787