CVE-2021-44521: Cassandra all Apache Cassandra Vulnerable To Code Vulnerability

CRITICAL
Advisory Identifier: GHSA-8ffc-79xg-29w8
CVSS 9.1
CWE-732 CWE-94
Published
Advisory Summary

CVE-2021-44521 is a CRITICAL (CVSS 9.1) apache cassandra vulnerable to code vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Cassandra all libraries in the Maven ecosystem. The issue involves apache cassandra vulnerable to code injection due to unsafe configuration. Remediation is available by upgrading affected packages to version 3.0.26, 3.11.12, 4.0.2.

CVE-2021-44521 at a Glance

CVE Identifier CVE-2021-44521
GHSA Identifier GHSA-8ffc-79xg-29w8
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-732: Incorrect Permission Assignment for Critical Resource
Affected Product Cassandra all
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.1

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

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

How to Fix CVE-2021-44521

To remediate this vulnerability, upgrade all affected Cassandra all 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.cassandra:cassandra-all fixed: 3.0.26
<dependency>
    <groupId>org.apache.cassandra</groupId>
    <artifactId>cassandra-all</artifactId>
    <version>3.0.26</version>
</dependency>
org.apache.cassandra:cassandra-all fixed: 3.11.12
<dependency>
    <groupId>org.apache.cassandra</groupId>
    <artifactId>cassandra-all</artifactId>
    <version>3.11.12</version>
</dependency>
org.apache.cassandra:cassandra-all fixed: 4.0.2
<dependency>
    <groupId>org.apache.cassandra</groupId>
    <artifactId>cassandra-all</artifactId>
    <version>4.0.2</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.cassandra

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.apache.cassandra 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-732: Incorrect Permission Assignment for Critical Resource, where the product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. In Cassandra all, 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

When running Apache Cassandra with the following configuration: enable_user_defined_functions: true enable_scripted_user_defined_functions: true enable_user_defined_functions_threads: false it is possible for an attacker to execute arbitrary code on the host. The attacker would need to have enough permissions to create user defined functions in the cluster to be able to exploit this. Note that this configuration is documented as unsafe, and will continue to be considered unsafe after this CVE.

CVE-2021-44521 Affected Cassandra all Versions

3 component(s)
Fixed Versions:
3.0.263.11.124.0.2
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.cassandra:cassandra-all
Maven
< 3.0.26
3.0.26
org.apache.cassandra:cassandra-all
Maven
≥ 3.11.0
< 3.11.12
3.11.12
org.apache.cassandra:cassandra-all
Maven
≥ 4.0.0
< 4.0.2
4.0.2

References

Frequently Asked Questions

What is CVE-2021-44521?
CVE-2021-44521 is a security vulnerability in Cassandra all involving Apache Cassandra vulnerable to Code Injection due to unsafe configuration under CWE-732: Incorrect Permission Assignment for Critical Resource.
Which Cassandra all versions are affected?
Affected versions include releases prior to 3.0.26, 3.11.12, 4.0.2 across affected packages: org.apache.cassandra:cassandra-all.
What version fixes CVE-2021-44521?
Upgrading to 3.0.26, 3.11.12, 4.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cassandra-all affected?
Yes, org.apache.cassandra:cassandra-all is affected in releases prior to 3.0.26, 3.11.12, 4.0.2. Upgrade your dependency to 3.0.26, 3.11.12, 4.0.2 or later.
What is the CVSS score of CVE-2021-44521?
CVE-2021-44521 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2021-44521?
CVE-2021-44521 is classified under CWE-732: Incorrect Permission Assignment for Critical Resource (The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.).
How can I check Maven dependencies for CVE-2021-44521?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.cassandra'. 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-8ffc-79xg-29w8",
  "modified" : "2022-08-11T19:20:55Z",
  "published" : "2022-02-12T00:00:48Z",
  "aliases" : [ "CVE-2021-44521" ],
  "summary" : "Apache Cassandra vulnerable to Code Injection due to unsafe configuration",
  "details" : "When running Apache Cassandra with the following configuration: enable_user_defined_functions: true enable_scripted_user_defined_functions: true enable_user_defined_functions_threads: false it is possible for an attacker to execute arbitrary code on the host. The attacker would need to have enough permissions to create user defined functions in the cluster to be able to exploit this. Note that this configuration is documented as unsafe, and will continue to be considered unsafe after this CVE.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cassandra:cassandra-all"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cassandra:cassandra-all"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.11.0"
      }, {
        "fixed" : "3.11.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cassandra:cassandra-all"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-44521"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/cassandra"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/CASSANDRA-17352"
  }, {
    "type" : "WEB",
    "url" : "https://jfrog.com/blog/cve-2021-44521-exploiting-apache-cassandra-user-defined-functions-for-remote-code-execution"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/y4nb9s4co34j8hdfmrshyl09lokm7356"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20220225-0001"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/02/11/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-732", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-02-23T16:10:04Z",
    "nvd_published_at" : "2022-02-11T13:15:00Z"
  }
}