Learn about CVE-2021-32829, a critical post-authentication Remote Code Execution (RCE) vulnerability in ZStack REST API. Understand the impact, affected versions, and mitigation steps.
ZStack, an open-source IaaS software, is vulnerable to a post-authentication Remote Code Execution (RCE) issue due to the bypass of the Groovy shell sandbox. Attackers can exploit this vulnerability through the exposed zstack/v1/batch-queries?script endpoint in the REST API, leading to critical impact.
Understanding CVE-2021-32829
This vulnerability affects ZStack REST API versions < 3.8.21, >=3.10.0 and < 3.10.8, and >=4.0.0 and < 4.1.0. It allows attackers to execute remote code post-authentication by bypassing the Groovy shell sandbox.
What is CVE-2021-32829?
ZStack, an Infrastructure as a Service software, suffers from a post-authentication Remote Code Execution (RCE) vulnerability. The weakness arises due to the inadequate restrictions on user-controlled Groovy scripts within the REST API.
The Impact of CVE-2021-32829
The vulnerability poses a critical threat, leading to post-authenticated remote code execution. It enables attackers to bypass the Groovy shell sandbox in the ZStack REST API, compromising the confidentiality and integrity of the system.
Technical Details of CVE-2021-32829
The vulnerability exists due to the evaluation of user-controlled Groovy scripts in the BatchQuery.query method, where the sandbox fails to restrict code in Java annotations, permitting meta-programming escapes.
Vulnerability Description
The flaw in ZStack's REST API allows for post-authentication RCE by leveraging the script endpoint, potentially executing malicious commands.
Affected Systems and Versions
ZStack versions < 3.8.21, >=3.10.0 and < 3.10.8, and >=4.0.0 to < 4.1.0 are impacted by this vulnerability.
Exploitation Mechanism
Attackers can exploit this issue by crafting a malicious Groovy script within the script parameter of zstack/v1/batch-queries, circumventing the sandbox restrictions.
Mitigation and Prevention
To address CVE-2021-32829, immediate action is required to secure ZStack installations and prevent potential RCE attacks.
Immediate Steps to Take
Long-Term Security Practices
Patching and Updates
Ensure timely patching of ZStack installations to the latest secure versions to prevent exploitation of known vulnerabilities.