Critical Buffer Overflow in ncurses Package Leading to Potential Code Execution

ncurses Updated 02 Oct 2025

Summary

22/11/2017
N/A
Yes i
High
7.8

ALPINE-CVE-2017-16879: 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 terminf... Affects ncurses versions < 6.0_p20171125-r0. Fixed in 6.0_p20171125-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The ncurses package is a widely used library in Unix-like systems that provides functions to create text-based user interfaces in a terminal. It allows developers to manage multiple windows, handle keyboard input, and manipulate text display. However, a vulnerability has been identified in ncurses that could lead to severe security risks, including application crashes and arbitrary code execution.

Vulnerability Detail

The vulnerability, identified as CVE-2017-16879, is a stack-based buffer overflow in the _nc_write_entry function located in tinfo/write_entry.c of the ncurses library version 6.0. This flaw allows attackers to exploit crafted terminfo files, potentially leading to denial of service or execution of arbitrary code. The vulnerability has a CVSS score of 7.8, indicating a high severity level, and poses significant risks to systems utilizing this library.

How To Fix

Minimum fixed version

6.0_p20171125-r0

This is the first release that contains the fix.

sudo apk add --upgrade ncurses

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using untrusted terminfo files and restrict access to the application to trusted users only. Additionally, consider running the application in a secure environment to mitigate risks.

Conclusion

The vulnerability in the ncurses package poses significant risks, including potential code execution and application crashes. It is crucial to update to the patched version to mitigate these risks. Utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.

See every vulnerability recorded for ncurses →

Share this vulnerability

FAQ

CVE-2017-16879 is a vulnerability in the ncurses package that allows for a stack-based buffer overflow, which can lead to application crashes or arbitrary code execution.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.

The CVSS score for CVE-2017-16879 is 7.8, indicating a high severity level.

If an immediate update is not possible, restrict access to the application and avoid using untrusted terminfo files as a temporary measure.

You can find more information about the ncurses library and its functionalities on its official documentation or repository.

Related vulnerabilities

Recent vulnerabilities recorded for ncurses.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

6.0_p20171125-r0

This is the first release that contains the fix.

sudo apk add --upgrade ncurses

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback