Out-of-Bounds Read and Segmentation Violation in ncurses

ncurses Updated 02 Oct 2025

Summary

18/04/2022
N/A
Yes i
High
7.1

CVE-2022-29458: ncurses 6.3 before patch 20220416 has an out-of-bounds read and segmentation violation in convert_strings in tinfo/read_entry.c in the terminfo library. Affects ncurses across 2 version ranges.

< 6.2_p20210109-r1 < deb0d07e8eb4803b9e9653359eab17a30d04369d

Fixed in 6.2_p20210109-r1. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

ncurses is a library that provides terminal-independent access to character screens. It is commonly used in Unix-like operating systems to create text-based user interfaces. The library allows developers to control the cursor position, display text in various colors, and handle keyboard input. However, a vulnerability has been discovered in ncurses version 6.3 and earlier that can lead to an out-of-bounds read and segmentation violation.

Vulnerability Detail

The vulnerability, identified as CVE-2022-29458, originates from a flaw in the convert_strings function in the tinfo/read_entry.c file of the terminfo library. Due to improper bounds checking, an attacker can exploit this vulnerability to read data beyond the intended buffer, potentially leading to a segmentation violation. This could result in a denial-of-service condition or even remote code execution if the attacker can control the data being read.

How To Fix

Minimum fixed version

6.2_p20210109-r1

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 workaround, users can consider implementing input validation and sanitization in their applications that utilize the ncurses library. By ensuring that user-supplied data is properly validated and restricted within the expected bounds, the risk of triggering the vulnerability can be mitigated.

Conclusion

The vulnerability in ncurses version 6.3 and earlier can lead to an out-of-bounds read and segmentation violation. It is crucial to update to the patched version or apply the recommended workarounds to mitigate the risk. For further assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ncurses →

Share this vulnerability

FAQ

ncurses is a library that provides terminal-independent access to character screens, allowing developers to create text-based user interfaces.

The vulnerability can lead to an out-of-bounds read and segmentation violation, potentially resulting in a denial-of-service condition or remote code execution.

Versions of ncurses prior to 6.3 with patch 20220416 are affected by this vulnerability.

To fix the vulnerability, update the ncurses library to version 6.3 with patch 20220416 or later.

Implementing input validation and sanitization in applications can help mitigate the risk of triggering the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for ncurses.

How To Fix

Minimum fixed version

6.2_p20210109-r1

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