CVE-2021-44521 Remote code execution for scripted UDFs

Critical 9.1 Published Updated

Attackers with UDF creation permissions can execute arbitrary code on Apache Cassandra hosts when unsafe scripted UDF settings are enabled.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-44521?

CVE-2021-44521 is a critical code injection vulnerability in Apache Cassandra, published on 11 Feb 2022. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

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.

Weakness: CWE-732, CWE-94

Which versions are affected by CVE-2021-44521?

7 open source packages ship an affected version, including org.apache.cassandra:cassandra-all and cassandra. It affects 1 product.

PackageAffectedFixed in
org.apache.cassandra:cassandra-all MavenAll versions3.0.26
org.apache.cassandra:cassandra-all MavenAll versions3.0.26
org.apache.cassandra:cassandra-all MavenFrom 3.11.03.11.12
org.apache.cassandra:cassandra-all MavenFrom 3.11.03.11.12
org.apache.cassandra:cassandra-all MavenFrom 4.0.04.0.2
org.apache.cassandra:cassandra-all MavenFrom 4.0.04.0.2
1 more packages
cassandra BitnamiFrom 3.0.03.0.26, 3.11.12, 4.0.2

Products include Apache Cassandra.

How do I fix CVE-2021-44521?

Upgrade org.apache.cassandra:cassandra-all to a fixed version for your release line: 3.0.26, 3.11.12 or 4.0.2.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2021-44521 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-44521 exists.

Public exploit code: 1 Nuclei template and 2 proofs of concept on GitHub.

Sources

Also known as BIT-cassandra-2021-44521, ECHO-2550-1834-d752, GHSA-8ffc-79xg-29w8, MINI-4jjc-74vc-3j6j, MINI-mxmp-hw8g-mq2f.

Is CVE-2021-44521 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free