CVE-2021-32829
JSON

9.6critical

Post-authentication Remote Code Execution (RCE) in ZStack REST API

Severity
9.6critical CVSS:3.1 by GitHub_M
Exploit likelihood
2.90% (higher than 87% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

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.

Affected

Product or packageVersionsReported by
zstackio zstack< 3.8.21, >=3.10.0, < 3.10.8, >=4.0.0, < 4.1.0CVE List
zstack rest_apifrom 2.2.4 before 3.8.21, from 3.10.0 before 3.10.8NVD

All scores

GitHub_M9.6critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
NVD9.9critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
NVD6.5medium CVSS:2.0AV:N/AC:L/Au:S/C:P/I:P/A:P

Classification

What each source says

CVE List

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.

NVD (es)

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2021-32829 changed 2024-08-03CVE Terms of Use
NVDCVE-2021-32829 changed 2026-06-17Public domain