CVE-2021-22696: Cxf Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-7q4h-pj78-j7vg
CVSS 7.5
CWE-400 CWE-918
Published
Advisory Summary

CVE-2021-22696 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Cxf libraries in the Maven ecosystem. The issue involves authorization service vulnerable to ddos attacks in apache cfx. Remediation is available by upgrading affected packages to version 3.4.3, 3.3.10.

CVE-2021-22696 at a Glance

CVE Identifier CVE-2021-22696
GHSA Identifier GHSA-7q4h-pj78-j7vg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Cxf
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2021-22696

To remediate this vulnerability, upgrade all affected Cxf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.cxf:cxf fixed: 3.4.3
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf</artifactId>
    <version>3.4.3</version>
</dependency>
org.apache.cxf:cxf fixed: 3.3.10
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf</artifactId>
    <version>3.3.10</version>
</dependency>
org.apache.cxf:apache-cxf fixed: 3.4.3
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>apache-cxf</artifactId>
    <version>3.4.3</version>
</dependency>
org.apache.cxf:apache-cxf fixed: 3.3.10
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>apache-cxf</artifactId>
    <version>3.3.10</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.cxf

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-22696, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.cxf

Analyze the terminal output to locate any version of Cxf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.cxf command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Cxf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2021-22696 Affected Cxf Versions

4 component(s)
Fixed Versions:
3.4.33.3.10
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.cxf:cxf
Maven
≥ 3.4.0
< 3.4.3
3.4.3
org.apache.cxf:cxf
Maven
< 3.3.10
3.3.10
org.apache.cxf:apache-cxf
Maven
≥ 3.4.0
< 3.4.3
3.4.3
org.apache.cxf:apache-cxf
Maven
< 3.3.10
3.3.10

References

NVD — CVE-2021-22696 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-22696
Security Fix Commit FIX COMMIT
https://github.com/apache/cxf/commit/40503a53914758759894f704bbf139ae89ace286
Security Fix Commit FIX COMMIT
https://github.com/apache/cxf/commit/aa789c5c4686597a7bdef2443909ab491fc2bc04
Cxf Security Information SECURITY
https://cxf.apache.org/security-advisories.data/CVE-2021-22696.txt.asc
Cxf Source Repository REPOSITORY
https://github.com/apache/cxf
lists.apache.org/thread.html/r644500... WEB
https://lists.apache.org/thread.html/r6445001cc5f9a2bb1e6316993753306e054bdd1d702656b7cbe59045@%3Cannounce.apache.org%3E
lists.apache.org/thread.html/r8651c0... WEB
https://lists.apache.org/thread.html/r8651c06212c56294a1c0ea61a5ad7790c06502209c03f05c0c7c9914@%3Cdev.cxf.apache.org%3E
lists.apache.org/thread.html/r8651c0... WEB
https://lists.apache.org/thread.html/r8651c06212c56294a1c0ea61a5ad7790c06502209c03f05c0c7c9914@%3Cusers.cxf.apache.org%3E
lists.apache.org/thread.html/rec7160... WEB
https://lists.apache.org/thread.html/rec7160382badd3ef4ad017a22f64a266c7188b9ba71394f0d321e2d4@%3Ccommits.cxf.apache.org%3E
lists.apache.org/thread.html/rfb87e0... WEB
https://lists.apache.org/thread.html/rfb87e0bf3995e7d560afeed750fac9329ff5f1ad49da365129b7f89e@%3Ccommits.cxf.apache.org%3E
Cxf Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2022.html
Cxf Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2021.html
Cxf Security Information SECURITY
http://www.openwall.com/lists/oss-security/2021/04/02/2

Frequently Asked Questions

What is CVE-2021-22696?
CVE-2021-22696 is a security vulnerability in Cxf involving Authorization service vulnerable to DDos attacks in Apache CFX under CWE-400: Uncontrolled Resource Consumption.
Which Cxf versions are affected?
Affected versions include releases prior to 3.4.3, 3.3.10 across affected packages: org.apache.cxf:cxf, org.apache.cxf:apache-cxf.
What version fixes CVE-2021-22696?
Upgrading to 3.4.3, 3.3.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cxf affected?
Yes, org.apache.cxf:cxf is affected in releases prior to 3.4.3, 3.3.10. Upgrade your dependency to 3.4.3, 3.3.10 or later.
Is apache-cxf affected?
Yes, org.apache.cxf:apache-cxf is affected in releases prior to 3.4.3, 3.3.10. Upgrade your dependency to 3.4.3, 3.3.10 or later.
What is the CVSS score of CVE-2021-22696?
CVE-2021-22696 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-22696?
CVE-2021-22696 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Maven dependencies for CVE-2021-22696?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.cxf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7q4h-pj78-j7vg",
  "modified" : "2021-10-21T17:14:23Z",
  "published" : "2021-05-13T22:31:05Z",
  "aliases" : [ "CVE-2021-22696" ],
  "summary" : "Authorization service vulnerable to DDos attacks in Apache CFX",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:cxf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.4.0"
      }, {
        "fixed" : "3.4.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:cxf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:apache-cxf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.4.0"
      }, {
        "fixed" : "3.4.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:apache-cxf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-22696"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/cxf/commit/40503a53914758759894f704bbf139ae89ace286"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/cxf/commit/aa789c5c4686597a7bdef2443909ab491fc2bc04"
  }, {
    "type" : "WEB",
    "url" : "https://cxf.apache.org/security-advisories.data/CVE-2021-22696.txt.asc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/cxf"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r6445001cc5f9a2bb1e6316993753306e054bdd1d702656b7cbe59045@%3Cannounce.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r8651c06212c56294a1c0ea61a5ad7790c06502209c03f05c0c7c9914@%3Cdev.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r8651c06212c56294a1c0ea61a5ad7790c06502209c03f05c0c7c9914@%3Cusers.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rec7160382badd3ef4ad017a22f64a266c7188b9ba71394f0d321e2d4@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rfb87e0bf3995e7d560afeed750fac9329ff5f1ad49da365129b7f89e@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2021/04/02/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-04-05T18:02:48Z",
    "nvd_published_at" : "2021-04-02T10:15:00Z"
  }
}