CVE-2021-32829
Post-authentication Remote Code Execution (RCE) in ZStack REST API
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
1Exploited in Wild
-Decision
Descriptions
ZStack is open source IaaS(infrastructure as a service) software aiming to automate datacenters, managing resources of compute, storage, and networking all by APIs. Affected versions of ZStack REST API are vulnerable to post-authentication Remote Code Execution (RCE) via bypass of the Groovy shell sandbox. The REST API exposes the GET zstack/v1/batch-queries?script endpoint which is backed up by the BatchQueryAction class. Messages are represented by the APIBatchQueryMsg, dispatched to the QueryFacadeImpl facade and handled by the BatchQuery class. The HTTP request parameter script is mapped to the APIBatchQueryMsg.script property and evaluated as a Groovy script in BatchQuery.query the evaluation of the user-controlled Groovy script is sandboxed by SandboxTransformer which will apply the restrictions defined in the registered (sandbox.register()) GroovyInterceptor. Even though the sandbox heavily restricts the receiver types to a small set of allowed types, the sandbox is non effective at controlling any code placed in Java annotations and therefore vulnerable to meta-programming escapes. This issue leads to post-authenticated remote code execution. For more details see the referenced GHSL-2021-065. This issue is patched in versions 3.8.21, 3.10.8, and 4.1.0.
ZStack es un software IaaS (infraestructura como servicio) de código abierto cuyo objetivo es automatizar los centros de datos, administrando los recursos de computación, almacenamiento y red, todo ello mediante API. Las versiones afectadas de la API REST de ZStack son vulnerables a una ejecución de código remota (RCE) después de la autenticación, por medio de una omisión del sandbox shell de Groovy. La API REST expone el endpoint GET zstack/v1/batch-queries?script que está respaldado por la clase BatchQueryAction. Los mensajes son representados por el APIBatchQueryMsg, enviados a la fachada QueryFacadeImpl y manejados por la clase BatchQuery. El script del parámetro de petición HTTP se asigna a la propiedad APIBatchQueryMsg.script y se evalúa como un script Groovy en BatchQuery.query la evaluación del script Groovy controlado por el usuario es sandboxed por SandboxTransformer que aplicará las restricciones definidas en el registrado (sandbox.register()) GroovyInterceptor. A pesar de que el sandbox restringe fuertemente los tipos del receptor a un pequeño conjunto de tipos permitidos, el sandbox no es efectivo en el control de cualquier código colocado en las anotaciones de Java y por lo tanto es vulnerable a los escapes de meta-programación. Este problema conlleva a una ejecución de código remota post-autenticada. Para más detalles, consulte la referencia GHSL-2021-065. Este problema está parcheado en versiones 3.8.21, 3.10.8 y 4.1.0.
CVSS Scores
SSVC
- Decision:-
Timeline
- 2021-05-12 CVE Reserved
- 2021-08-17 CVE Published
- 2024-08-03 CVE Updated
- 2024-08-03 First Exploit
- 2024-09-19 EPSS Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
CWE
- CWE-94: Improper Control of Generation of Code ('Code Injection')
- CWE-863: Incorrect Authorization
CAPEC
References (3)
URL | Tag | Source |
---|---|---|
https://blog.orange.tw/2019/02/abusing-meta-programming-for-unauthenticated-rce.html | Not Applicable | |
https://github.com/zstackio/zstack/security/advisories/GHSA-6xgq-7rqg-x3q5 | Third Party Advisory |
URL | Date | SRC |
---|---|---|
https://securitylab.github.com/advisories/GHSL-2021-065-zstack | 2024-08-03 |
URL | Date | SRC |
---|
URL | Date | SRC |
---|
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Zstack Search vendor "Zstack" | Rest Api Search vendor "Zstack" for product "Rest Api" | >= 2.2.4 < 3.8.21 Search vendor "Zstack" for product "Rest Api" and version " >= 2.2.4 < 3.8.21" | - |
Affected
| ||||||
Zstack Search vendor "Zstack" | Rest Api Search vendor "Zstack" for product "Rest Api" | >= 3.10.0 < 3.10.8 Search vendor "Zstack" for product "Rest Api" and version " >= 3.10.0 < 3.10.8" | - |
Affected
|