Rest ApiApplication · Zstack

CVE-2021-32829

CRITICAL · 9.9 CVSS v3.1 Published 2021-08-17
Fix available
A fix is available. Upgrade to 3.8.21 / 3.10.8 or later.
See remediation →
100/100
Remediation priority · Urgent
Public exploit Remotely reachable Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis
How this class of weakness works · CWE-94

The application evaluates attacker-influenced input as code, handing them a way to run logic inside the process. Depending on the runtime this can escalate directly to remote code execution. Remediation means removing dynamic evaluation of untrusted input and replacing it with safe, data-driven alternatives.

General guidance for the code injection class — the official description and references above are authoritative for this specific CVE. Want a bespoke review and a reviewed fix? Ask our team →

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Rest ApiApplication
Affected:>= 2.2.4, < 3.8.21>= 3.10.0, < 3.10.8

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 3.8.21 / 3.10.8 or later
Fixed in 3.8.213.10.8
Recommended fix High confidence

Upgrade to ZStack version 3.8.21, 3.10.8, or 4.1.0 (choose based on current major version)

  1. 1. Identify the current ZStack REST API version by checking the management console or running: zstack-cli -l or checking /opt/zstack/version.properties
  2. 2. If running version >= 2.2.4 and < 3.8.21: upgrade to version 3.8.21 or 3.10.8
  3. 3. If running version >= 3.10.0 and < 3.10.8: upgrade to version 3.10.8
  4. 4. If running version >= 3.8.21 and < 3.10.0: upgrade to version 3.10.8
  5. 5. Obtain the upgrade package from the official ZStack repository or download center
  6. 6. Follow the standard ZStack upgrade procedure: stop the ZStack services, backup the database, run the upgrade installer, verify the upgrade
  7. 7. After upgrade, verify the fix by confirming the version number matches a patched release (3.8.21, 3.10.8, or 4.1.0)
  8. 8. Test that the vulnerable endpoint zstack/v1/batch-queries?script no longer executes arbitrary Groovy code even with sandbox bypass attempts
Caveat As with any infrastructure software upgrade, test in a non-production environment first; review release notes for any breaking changes between your current version and the target version

Generated from the published advisory — verify against the referenced sources before acting.

We can perform the upgrade in your staging environment and verify nothing breaks — typical engagement from $3,550. Get the upgrade done

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2021-32829 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-32829 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data