Authenticating to Vault
Two authentication bypasses existed in Vault's AWS and GCP auth methods. An attacker could impersonate a privileged cloud identity and obtain a Vault session token, gaining access to stored secrets.
googleprojectzero.blogspot.com
Published on googleprojectzero.blogspot.com
In this blog post I'll discuss two vulnerabilities in HashiCorp Vault and its integration with Amazon Web Services (AWS) and Google Cloud Platform (GCP). These issues can lead to an authentication bypass in configurations that use the aws and gcp auth methods, and demonstrate the type of issues you can find in modern…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the AWS path forwarded attacker-controlled request parts to STS and parsed the reply as XML without checking it was XML, while the GCP path trusted token headers before verifying the signature.
Impact
An attacker who knows the name of a privileged AWS role could obtain a Vault token and read secrets; the GCP flaw could bypass authentication in many configurations.
What the attacker needed
Attacker-owned AWS account; attacker-hosted OIDC provider; knowledge of a privileged role name
The fix
HashiCorp fixed it by enforcing a header allowlist, restricting requests to the caller identity action and validating the STS response more strictly.
How it was found
- Create a minimal OIDC identity provider with your own signing keys and host its discovery documents.
- Register that provider and an IAM role mapping in an AWS account you control.
- Sign a JWT whose subject claim contains a fake caller identity response.
- Send a direct request to the STS web identity action to confirm the subject is reflected in the JSON reply.
- Convert the request into the form Vault expects and send it to the AWS login endpoint.
- Receive a Vault session token for the spoofed privileged role and use it to fetch secrets.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Vault is a central store for passwords and keys. It can let cloud services log in by proving which cloud identity they run as. The bugs let someone pretend to be a trusted cloud identity and get a Vault login token, so they could read secrets they should not see.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.