Hi team,
CVE-2021-44521 – Exploiting Apache Cassandra User-Defined Functions for Remote Code Execution
Do we have to take any changes from DB side apart from upgrading to fixed versions ?
Regards,
Mani Rangu
Bringing together the Apache Cassandra experts from the community and DataStax.
Want to learn? Have a question? Want to share your expertise? You are in the right place!
Not sure where to begin? Getting Started
Hi team,
CVE-2021-44521 – Exploiting Apache Cassandra User-Defined Functions for Remote Code Execution
Do we have to take any changes from DB side apart from upgrading to fixed versions ?
Regards,
Mani Rangu
You can reference CASSANDRA-17352, if you upgrade to a fixed version that is the only action necessary.
Hi @starlord ,
Thanks for the update.
We recently upgraded Cassandra db to 4.0.1 so we are keeping upgrade as 2nd option.
As per this ticket https://issues.apache.org/jira/browse/CASSANDRA-17352 ,
We will be good if we set this parameter(enable_user_defined_functions_threads: true) in cassandra.yaml ?
Regards,
Mani Rangu
An attacker can exploit the vulnerability described in CVE-2021-44521 if scripted user-defined functions are enabled on a node (disabled by default):
enable_user_defined_functions: true enable_scripted_user_defined_functions: true
and UDF threads is disabled (default is true
):
enable_user_defined_functions_threads: false
A cluster is not vulnerable to the exploit under the following conditions:
For a cluster to be vulnerable, an administrator has chosen to disable UDF threads against recommendation and it is not safe to do so.
An attacker requires permissions to create user-defined functions and nodes are particularly vulnerable if authentication is not enabled on the cluster:
authenticator: AllowAllAuthenticator
It is possible for an attacker to create functions that can execute arbitrary code on a node with this exploit.
Disabling UDF threads is insecure and not recommended since it effectively disables the security manager in Java.
Re-enable UDF threads in cassandra.yaml
and restart each node in the cluster for the change to take effect:
enable_user_defined_functions_threads: true
CVE-2021-44521 has been patched in Apache Cassandra 3.0.26, 3.11.12 and 4.0.2 (CASSANDRA-17352).
If an administrator wants to run user-defined functions without threads (not recommended) on patched clusters, an administrator will need to explicitly allow insecure UDFs with:
allow_insecure_udfs: true
in cassandra.yaml
. If existing UDFs require access to java.lang.System
(not recommended), set:
allow_extra_insecure_udfs: true
Note that it is not necessary to upgrade if UDF threads is enabled (default) on a cluster.
6 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2022 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use