Bug 1766617 (CVE-2019-17595) - CVE-2019-17595 ncurses: heap-based buffer overflow in the fmt_entry function in tinfo/comp_hash.c
Summary: CVE-2019-17595 ncurses: heap-based buffer overflow in the fmt_entry function ...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2019-17595
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1766618 1785703 1785704
Blocks: 1766620
TreeView+ depends on / blocked
 
Reported: 2019-10-29 14:03 UTC by Guilherme de Almeida Suckevicz
Modified: 2023-09-07 20:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-25 09:55:57 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4426 0 None None None 2021-11-09 18:44:45 UTC

Description Guilherme de Almeida Suckevicz 2019-10-29 14:03:49 UTC
There is a heap-based buffer over-read in the fmt_entry function in tinfo/comp_hash.c in the terminfo library in ncurses before 6.1-20191012.

Reference:
https://lists.gnu.org/archive/html/bug-ncurses/2019-10/msg00013.html

Comment 1 Guilherme de Almeida Suckevicz 2019-10-29 14:04:05 UTC
Created ncurses tracking bugs for this issue:

Affects: fedora-all [bug 1766618]

Comment 3 Marco Benatto 2019-12-20 15:05:12 UTC
Upstream commit for this issue:

https://github.com/mirror/ncurses/commit/b025434573f466efe27862656a6a9d41dd2bd609

 ncurses 6.1 - patch 20191012

+ amend recent changes to ncurses*-config and pc-files to filter out
  Debian linker-flags (report by Sven Joachim, cf: 20150516).
+ clarify relationship between tic, infocmp and captoinfo in manpage.
+ check for invalid hashcode in _nc_find_type_entry and
  _nc_find_name_entry.
> fix several errata in tic (reports/testcases by "zjuchenyuan"):
+ check for invalid hashcode in _nc_find_entry.
+ check for missing character after backslash in fmt_entry
+ check for acsc with odd length in dump_entry in check for one-one
  mapping (cf: 20060415);
+ check length when converting from old AIX box_chars_1 capability,
  overlooked in changes to eliminate strcpy (cf: 20001007).
+ amend the ncurses*-config and pc-files to take into account the rpath

Comment 7 Marco Benatto 2019-12-20 18:55:03 UTC
There's an issue with ncurses library when using infotocap tool to read and dump terminal capabilities from terminfo files. A termeinfo file is a database which described terminal capabilities and screen operations used by several screen-oriented programs. When dumping terminfo data, infotocap parses the input file but misses to check NULL byte terminators on some scenarios leading to a heap-based buffer overflow by reading extra bytes beyond the allocated buffer. An attack may leverage this by crafting a special terminfo input file leading the application to crash, thus causing DoS, to dump extra bytes from heap causing a low confidentiality impact.

Comment 16 errata-xmlrpc 2021-11-09 18:44:44 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:4426 https://access.redhat.com/errata/RHSA-2021:4426


Note You need to log in before you can comment on or make changes to this bug.