Bug 1946341 (CVE-2021-22696) - CVE-2021-22696 cxf: OAuth 2 authorization service vulnerable to DDos attacks
Summary: CVE-2021-22696 cxf: OAuth 2 authorization service vulnerable to DDos attacks
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2021-22696
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:
Blocks: 1946342
TreeView+ depends on / blocked
 
Reported: 2021-04-05 20:05 UTC by Guilherme de Almeida Suckevicz
Modified: 2022-11-02 10:40 UTC (History)
84 users (show)

Fixed In Version: cxf-3.3.10 cxf-3.4.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-14 22:05:34 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:5134 0 None Waiting on Red Hat Nodes fails to schedule pods when they are too many 2022-06-01 15:04:06 UTC
Red Hat Product Errata RHSA-2022:7273 0 None None None 2022-11-02 10:40:47 UTC

Description Guilherme de Almeida Suckevicz 2021-04-05 20:05:29 UTC
CXF supports (via JwtRequestCodeFilter) passing OAuth 2 parameters via a JWT token as opposed to query parameters (see: The OAuth 2.0 Authorization Framework: JWT Secured Authorization Request (JAR)). Instead of sending a JWT token as a "request" parameter, the spec also supports specifying a URI from which to retrieve a JWT token from via the "request_uri" parameter. CXF was not validating the "request_uri" parameter (apart from ensuring it uses "https) and was making a REST request to the parameter in the request to retrieve a token. This means that CXF was vulnerable to DDos attacks on the authorization server, as specified in section 10.4.1 of the spec. This issue affects Apache CXF versions prior to 3.4.3; Apache CXF versions prior to 3.3.10.

Reference:
https://cxf.apache.org/security-advisories.data/CVE-2021-22696.txt.asc
https://lists.apache.org/thread.html/r6445001cc5f9a2bb1e6316993753306e054bdd1d702656b7cbe59045@%3Cannounce.apache.org%3E

Comment 1 Mark Cooper 2021-04-07 02:40:14 UTC
Looking at the binary from here: http://cxf.apache.org/download.html
    apache-cxf-3.4.3]$ grep -r JwtRequestCodeFilter 
    Binary file lib/cxf-rt-rs-security-oauth2-3.4.3.jar matches

That makes sense given that it's a DoS in the OAuth service. Based on this OpenShift products do not package cxf-rt-rs-security-oauth2 at all, so marking logging-elasticsearch containers as not affected.

Comment 2 Mark Cooper 2021-04-07 03:43:32 UTC
External References:

https://cxf.apache.org/security-advisories.data/CVE-2021-22696.txt.asc

Comment 3 Mark Cooper 2021-04-07 04:15:48 UTC
I believe the upstream fix is to disable request_uri:
 - https://github.com/apache/cxf/commit/7d5d2c7a019dd1e1d0566daf9f1ed5b7b0dd66b7

Especially given:
    This method must be overridden to support request_uri. Take care to validate the request_uri properly,
     * as otherwise it could lead to a security problem
     * (https://tools.ietf.org/html/draft-ietf-oauth-jwsreq-30#section-10.4)

And possibly also to ensure both request_uri and request can't exist together:
 - https://github.com/apache/cxf/commit/aee3bf291a7387cc492aa0dbdb0fb2af96687994

Comment 6 Mark Cooper 2021-04-08 03:32:57 UTC
Addition to comment #1 OpenShift 3.11 openshift3/ose-logging-elasticsearch5 does not have any reference to the cxf package and hence isn't added to the affects whiteboard, just openshift 4.

Comment 14 errata-xmlrpc 2021-12-14 21:35:00 UTC
This issue has been addressed in the following products:

  Red Hat Fuse 7.10

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

Comment 15 Product Security DevOps Team 2021-12-14 22:05:28 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-22696

Comment 16 cmario 2022-01-24 18:55:27 UTC
Issue persists with fuse - 3.3.6.fuse-7_10_0-00022-redhat-00001.

Can someone confirm if the issue was resolved?

Comment 18 errata-xmlrpc 2022-11-02 10:40:43 UTC
This issue has been addressed in the following products:

  JWS 5.7.0

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


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