Bug 1766693 (CVE-2019-17041)

Summary: CVE-2019-17041 rsyslog: heap-based overflow in contrib/pmaixforwardedfrom/pmaixforwardedfrom.c
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dapospis, ebenes, jlieskov, jvymazal, lkundrak, mah.darade, rsroka, tosykora, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 22:35:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1766694, 1768320, 1768321    
Bug Blocks: 1766703    

Description Guilherme de Almeida Suckevicz 2019-10-29 16:50:56 UTC
An issue was discovered in Rsyslog v8.1908.0. contrib/pmaixforwardedfrom/pmaixforwardedfrom.c has a heap overflow in the parser for AIX log messages. The parser tries to locate a log message delimiter (in this case, a space or a colon) but fails to account for strings that do not satisfy this constraint. If the string does not match, then the variable lenMsg will reach the value zero and will skip the sanity check that detects invalid log messages. The message will then be considered valid, and the parser will eat up the nonexistent colon delimiter. In doing so, it will decrement lenMsg, a signed integer, whose value was zero and now becomes minus one. The following step in the parser is to shift left the contents of the message. To do this, it will call memmove with the right pointers to the target and destination strings, but the lenMsg will now be interpreted as a huge value, causing a heap overflow.

Reference:
https://github.com/rsyslog/rsyslog/pull/3884

Comment 1 Guilherme de Almeida Suckevicz 2019-10-29 16:52:56 UTC
Created rsyslog tracking bugs for this issue:

Affects: fedora-all [bug 1766694]

Comment 2 Huzaifa S. Sidhpurwala 2019-11-04 04:45:15 UTC
Upstream patch: https://github.com/rsyslog/rsyslog/pull/3884/commits/10549ba915556c557b22b3dac7e4cb73ad22d3d8

Analysis:

Essentially a heap buffer overflow when parsing certain AIX log messages which have misplaced delimiters. Normally logs are system generated and therefore difficult to craft in order to achieve code execution for this flaw. Therefore it should mostly result in crash.

Comment 3 errata-xmlrpc 2020-03-31 19:09:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:1000 https://access.redhat.com/errata/RHSA-2020:1000

Comment 4 Product Security DevOps Team 2020-03-31 22:35:40 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-17041

Comment 5 errata-xmlrpc 2020-04-28 15:42:11 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2020:1702 https://access.redhat.com/errata/RHSA-2020:1702