Bug 2034067 (CVE-2021-45105)

Summary: CVE-2021-45105 log4j-core: DoS in log4j 2.x with Thread Context Map (MDC) input data contains a recursive lookup and context lookup pattern
Product: [Other] Security Response Reporter: Ted Jongseok Won <jwon>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aboyko, agawand, ahenning, aileenc, akoufoud, alazarot, almorale, anstephe, aos-bugs, asoldano, atangrin, ataylor, avibelli, bbaranow, bbuckingham, bcourt, bdettelb, bgeorges, bibryam, bihu, bmaxwell, bmontgom, boliveir, brian.stansberry, btotty, cdewolf, chazlett, clement.escoffier, crarobin, dandread, darran.lofthouse, dbhole, devrim, dkreling, dosoudil, drieden, ehelms, eleandro, eparis, etirelli, ewolinet, fcanogab, fjuma, ggaughan, gmalinko, gsmet, hamadhan, hbraun, hhorak, hvyas, ibek, iweiss, janstey, java-sig-commits, jburrell, jcantril, jmadigan, jnethert, jochrist, jokerman, jorton, jpallich, jperkins, jrokos, jross, jsherril, jstastny, jwon, kaycoth, krathod, kverlaen, kwills, lgao, lthon, lzap, mbagga, mhulan, mizdebsk, mmccune, mnovotny, msochure, msvehla, mszynkie, myarboro, ngough, nmoumoul, nstielau, nwallace, orabin, pamccart, pantinor, paul.wouters, pcreech, pdelbell, pdrozd, peholase, pgallagh, pjindal, pmackay, probinso, pskopek, rchan, rguimara, rpalathi, rrajasek, rruss, rstancel, rsvoboda, sbiarozk, sd-operator-metering, sdouglas, security-response-team, sfowler, sguilhen, skudupud, smaestri, sponnaga, sthorger, swoodman, syamamot, tflannag, tom.jenkinson, tzimanyi, vkumar, yborgess, yozone, ytale
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: log4j 2.17.0, log4j 2.12.3, log4j 2.3.1 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Apache Log4j logging library 2.x. when the logging configuration uses a non-default Pattern Layout with a Context Lookup. Attackers with control over Thread Context Map (MDC) input data can craft malicious input data that contains a recursive lookup and can cause Denial of Service.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-22 00:20:31 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: 2030985, 2034082, 2034083, 2034084, 2034089, 2034090, 2034091, 2034148    
Bug Blocks: 2030930    

Description Ted Jongseok Won 2021-12-20 02:28:51 UTC
Apache Log4j2 versions 2.0-alpha1 through 2.16.0 did not protect from uncontrolled recursion from self-referential lookups. When the logging configuration uses a non-default Pattern Layout with a Context Lookup (for example, $${ctx:loginId}), attackers with control over Thread Context Map (MDC) input data can craft malicious input data that contains a recursive lookup, resulting in a StackOverflowError that will terminate the process. This is also known as a DOS (Denial of Service) attack.

This issue is being tracked as LOG4J2-3230

Mitigation:

Implement one of the following mitigation techniques:

* Java 8 (or later) users should upgrade to release 2.17.0.

Alternatively, this can be mitigated in configuration:

* In PatternLayout in the logging configuration, replace Context Lookups like ${ctx:loginId} or $${ctx:loginId} with Thread Context Map patterns (%X, %mdc, or %MDC).
* Otherwise, in the configuration, remove references to Context Lookups like ${ctx:loginId} or $${ctx:loginId} where they originate from sources external to the application such as HTTP headers or user input.

Note that only the log4j-core JAR file is impacted by this vulnerability. Applications using only the log4j-api JAR file without the log4j-core JAR file are not impacted by this vulnerability.

Reference:
https://logging.apache.org/log4j/2.x/security.html
https://www.openwall.com/lists/oss-security/2021/12/19/1
https://issues.apache.org/jira/browse/LOG4J2-3230

Comment 1 Huzaifa S. Sidhpurwala 2021-12-20 04:20:53 UTC
Created log4j tracking bugs for this issue:

Affects: fedora-all [bug 2034082]

Comment 2 Huzaifa S. Sidhpurwala 2021-12-20 04:34:54 UTC
Upstream patch: https://github.com/apache/logging-log4j2/commit/806023265f8c905b2dd1d81fd2458f64b2ea0b5e

Comment 16 Yadnyawalk Tale 2021-12-20 15:35:13 UTC
Red Hat Satellite bundles log4j-over-slf4j with Candlepin, however, product is not affected as it uses logback framework for logging.

Comment 17 Bin Hu 2021-12-21 06:26:14 UTC
will JWS 3.x/5.x and Apache httpd also get affected?

Comment 18 Bin Hu 2021-12-21 06:50:28 UTC
Is AMQ broker 7.x get affected?

Comment 19 Product Security DevOps Team 2021-12-22 00:20:25 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-2021-45105

Comment 20 Ted Jongseok Won 2021-12-22 07:45:25 UTC
In reply to comment #17:
> will JWS 3.x/5.x and Apache httpd also get affected?

They are not affected.

Comment 21 Mithilesh Kaur Bagga 2021-12-22 16:34:08 UTC
Hello Team,

Is this https://access.redhat.com/security/cve/cve-2021-45105 fixed in Openshift 3.11.570?

Looking for RHSA but the CVE page didn't update: https://access.redhat.com/security/cve/cve-2021-45105

Please help with the same.

Comment 35 errata-xmlrpc 2022-01-10 06:38:47 UTC
This issue has been addressed in the following products:

  OpenShift Logging 5.1

Via RHSA-2022:0042 https://access.redhat.com/errata/RHSA-2022:0042

Comment 36 errata-xmlrpc 2022-01-10 07:15:44 UTC
This issue has been addressed in the following products:

  OpenShift Logging 5.2

Via RHSA-2022:0043 https://access.redhat.com/errata/RHSA-2022:0043

Comment 37 errata-xmlrpc 2022-01-10 07:29:22 UTC
This issue has been addressed in the following products:

  OpenShift Logging 5.3

Via RHSA-2022:0044 https://access.redhat.com/errata/RHSA-2022:0044

Comment 38 errata-xmlrpc 2022-01-10 12:24:54 UTC
This issue has been addressed in the following products:

  OpenShift Logging 5.0

Via RHSA-2022:0047 https://access.redhat.com/errata/RHSA-2022:0047

Comment 39 errata-xmlrpc 2022-01-12 09:50:54 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.6

Via RHSA-2022:0026 https://access.redhat.com/errata/RHSA-2022:0026

Comment 40 errata-xmlrpc 2022-01-20 09:27:01 UTC
This issue has been addressed in the following products:

  Red Hat Fuse 7.8.2
  7.9.1
  7.10.1

Via RHSA-2022:0203 https://access.redhat.com/errata/RHSA-2022:0203

Comment 41 errata-xmlrpc 2022-01-20 11:40:33 UTC
This issue has been addressed in the following products:

  Red Hat Data Grid 8.2.3

Via RHSA-2022:0205 https://access.redhat.com/errata/RHSA-2022:0205

Comment 42 errata-xmlrpc 2022-01-20 12:13:09 UTC
This issue has been addressed in the following products:

  Vert.x 4.1.8

Via RHSA-2022:0083 https://access.redhat.com/errata/RHSA-2022:0083

Comment 43 errata-xmlrpc 2022-01-20 16:00:13 UTC
This issue has been addressed in the following products:

  EAP 7.4 log4j async

Via RHSA-2022:0216 https://access.redhat.com/errata/RHSA-2022:0216

Comment 44 errata-xmlrpc 2022-01-20 18:19:39 UTC
This issue has been addressed in the following products:

  Red Hat AMQ Streams 1.6.6

Via RHSA-2022:0219 https://access.redhat.com/errata/RHSA-2022:0219

Comment 45 errata-xmlrpc 2022-01-20 18:56:06 UTC
This issue has been addressed in the following products:

  Red Hat Integration Camel Extensions for Quarkus 2.2

Via RHSA-2022:0222 https://access.redhat.com/errata/RHSA-2022:0222

Comment 46 errata-xmlrpc 2022-01-20 18:57:08 UTC
This issue has been addressed in the following products:

  Red Hat Integration Camel-K 1.6.3

Via RHSA-2022:0223 https://access.redhat.com/errata/RHSA-2022:0223

Comment 47 errata-xmlrpc 2022-04-11 12:56:42 UTC
This issue has been addressed in the following products:

  Red Hat JBoss Enterprise Application Platform 7.4 on RHEL 7

Via RHSA-2022:1296 https://access.redhat.com/errata/RHSA-2022:1296

Comment 48 errata-xmlrpc 2022-04-11 12:58:12 UTC
This issue has been addressed in the following products:

  Red Hat JBoss Enterprise Application Platform 7.4 for RHEL 8

Via RHSA-2022:1297 https://access.redhat.com/errata/RHSA-2022:1297

Comment 49 errata-xmlrpc 2022-04-11 13:00:55 UTC
This issue has been addressed in the following products:

  EAP 7.4.4 release

Via RHSA-2022:1299 https://access.redhat.com/errata/RHSA-2022:1299

Comment 50 errata-xmlrpc 2022-04-20 14:52:58 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On

Via RHSA-2022:1469 https://access.redhat.com/errata/RHSA-2022:1469

Comment 51 errata-xmlrpc 2022-04-20 14:56:14 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.5 for RHEL 7

Via RHSA-2022:1462 https://access.redhat.com/errata/RHSA-2022:1462

Comment 52 errata-xmlrpc 2022-04-20 14:59:18 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.5 for RHEL 8

Via RHSA-2022:1463 https://access.redhat.com/errata/RHSA-2022:1463