CVE-2021-30476
Description
HashiCorp Terraform’s Vault Provider (terraform-provider-vault) did not correctly configure GCE-type bound labels for Vault’s GCP auth method. Fixed in 2.19.1.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
2- HashiCorp/Terraform Vault Providerdescription
- Range: <2.19.1
Patches
Vulnerability mechanics
Root cause
"The vault_gcp_auth_backend_role resource does not apply bound_labels to the Vault GCP auth method role configuration."
Attack vector
An attacker with access to a GCE VM that is able to authenticate to Vault via the GCP auth method can gain authentication even when the Terraform configuration specifies `bound_labels` that should restrict which VMs are allowed [ref_id=1]. Because the provider silently fails to write the `bound_labels` to Vault, any GCE VM in the project can authenticate against the role, bypassing the intended label-based access control [ref_id=1]. The attacker does not need to modify Terraform state or configuration; they simply authenticate from a VM that lacks the required label, and Vault accepts the authentication because no label constraint was ever applied [ref_id=1].
Affected code
The vulnerability is in the `vault_gcp_auth_backend_role` resource of the HashiCorp Terraform Vault Provider (terraform-provider-vault). The resource does not apply the `bound_labels` configuration to the Vault GCP auth method role when `type` is set to `"gce"` [ref_id=1].
What the fix does
The advisory does not include a patch diff, but the fix was released in terraform-provider-vault version 2.19.1 [ref_id=1]. The remediation ensures that when a `vault_gcp_auth_backend_role` resource is created with `type = "gce"`, the `bound_labels` parameter is correctly written to Vault's GCP auth backend role configuration. Users must upgrade to version 2.19.1 or later and re-apply their Terraform configuration to ensure `bound_labels` are enforced.
Preconditions
- configThe Vault provider must be configured with a GCP auth backend and a vault_gcp_auth_backend_role resource of type 'gce' that specifies bound_labels
- authAn attacker must have access to a GCE VM that can authenticate to Vault via the GCP auth method
- networkThe attacker's VM must be in the same GCP project as the Vault auth backend role
Reproduction
1. Start a dev Vault instance: `vault server -dev -dev-root-token-id=root` 2. Create a Terraform configuration with a `vault_gcp_auth_backend_role` resource of type `"gce"` and `bound_labels = ["role:test"]` 3. Run `terraform init && terraform apply` 4. Verify the role configuration: `vault read auth/gcp/role/test-role` — note that `bound_labels` is missing from the output 5. Authenticate from a GCE VM that does not have the label `role:test` — authentication succeeds despite the Terraform configuration specifying the label constraint [ref_id=1]
Generated on May 25, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2News mentions
0No linked articles in our index yet.