RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1484291 - There is an illegal address access in strings.c of libncurses.
Summary: There is an illegal address access in strings.c of libncurses.
Keywords:
Status: CLOSED DUPLICATE of bug 1488922
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ncurses
Version: 7.5-Alt
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Miroslav Lichvar
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: CVE-2017-13734
TreeView+ depends on / blocked
 
Reported: 2017-08-23 08:11 UTC by owl337
Modified: 2018-07-27 15:25 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-27 15:25:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Triggered by " ./infotocap POC13 " (687 bytes, application/x-rar)
2017-08-23 08:11 UTC, owl337
no flags Details
The modified POC (181 bytes, application/x-rar)
2017-08-26 03:10 UTC, owl337
no flags Details

Description owl337 2017-08-23 08:11:15 UTC
Created attachment 1316983 [details]
Triggered by " ./infotocap POC13 "

Description of problem:

There is an illegal address access in strings.c of libncurses.

Version-Release number of selected component (if applicable):

<= latest version

How reproducible:

./infotocap POC13

Steps to Reproduce:

$ ./../../../infotocap POC13
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 9: dubious character `*' in name or alias field
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 11, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 14, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 22, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ';'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 24, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ','
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 68, terminal 'a*9拢觻[': Illegal character - '^\'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 68, terminal 'a*9拢觻[': unknown capability '5'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 69, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - '^\'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 180, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 183, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 190, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ';'
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 192, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - ','
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 208, terminal 'a*9拢觻[': Missing separator after `ac', have ^\
"id:000315,sig:11,src:000798,op:havoc,rep:16", line 1, col 209, terminal 'a*9拢觻[': Illegal character (expected alphanumeric or @%&*!#) - '^\'
Segmentation fault


The GDB debugging information is as follows:
(gdb) set args POC13
(gdb) set args POC13
(gdb) r
Starting program: /home/icy/secreal/ncurses-6.0-20170819/install/bin/infotocap POC13
"POC31", line 1, col 9: dubious character `*' in name or alias field
"POC13", line 1, col 11, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"POC13", line 1, col 14, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"POC13", line 1, col 22, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ';'
"POC13", line 1, col 24, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ','
"POC13", line 1, col 68, terminal 'a*9??[': Illegal character - '^\'
"POC13", line 1, col 68, terminal 'a*9??[': unknown capability '5'
"POC13", line 1, col 69, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - '^\'
"POC13", line 1, col 180, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"POC13", line 1, col 183, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ':'
"POC13", line 1, col 190, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ';'
"POC13", line 1, col 192, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - ','
"POC13", line 1, col 208, terminal 'a*9??[': Missing separator after `ac', have ^\
"POC13", line 1, col 209, terminal 'a*9??[': Illegal character (expected alphanumeric or @%&*!#) - '^\'

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:137
137	../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) bt 
#0  strlen () at ../sysdeps/x86_64/strlen.S:137
#1  0x00000000004528e2 in _nc_safe_strcat (dst=0x7fffffffadc0, 
    src=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>)
    at ../ncurses/./tinfo/strings.c:109
#2  0x0000000000446bfa in postprocess_termcap (tp=<optimized out>, has_base=<optimized out>)
    at ../ncurses/./tinfo/parse_entry.c:923
#3  _nc_parse_entry (entryp=0x7fffffffaf38, literal=<optimized out>, silent=<optimized out>)
    at ../ncurses/./tinfo/parse_entry.c:520
#4  0x000000000043db23 in _nc_read_entry_source (fp=<optimized out>, buf=<optimized out>, literal=0, silent=false, 
    hook=0x0) at ../ncurses/./tinfo/comp_parse.c:225
#5  0x0000000000403039 in main (argc=<optimized out>, argv=<optimized out>) at ../progs/tic.c:958

Trigged in:
_nc_safe_strcat (dst=0x7fffffffadc0, src=0x67d6ad "\r") at ../ncurses/./tinfo/strings.c:109
109		size_t len = strlen(src);

104	 */
105	NCURSES_EXPORT(bool)
106	_nc_safe_strcat(string_desc * dst, const char *src)
107	{
108	    if (src != 0) {
109		size_t len = strlen(src);
110	
111		if (len < dst->s_size) {
112		    if (dst->s_tail != 0) {
113			_nc_STRCPY(dst->s_tail, src, dst->s_size);

Actual results:

crash

Expected results:

crash

Additional info:

Credits:

This vulnerability is detected by team OWL337, with our custom fuzzer collAFL. Please contact ganshuitao   and chaoz.cn if you need more info about the team, the tool or the vulnerability.

Comment 2 Thomas E. Dickey 2017-08-25 22:42:44 UTC
The given test-case does not produce the reported problem.

Comment 3 owl337 2017-08-26 03:10:58 UTC
Created attachment 1318358 [details]
The modified POC

Sorry for this mistake.

Comment 4 Thomas E. Dickey 2017-08-26 13:57:39 UTC
I made a fix for this report which will be in the next set of updates.


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