CVE-2025-59048: OpenBao AWS Plugin Vulnerable to Cross-Account IAM Role Impersonation in AWS Auth Method
8.1
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/openbao/openbao-plugins | go | <= 0.1.0 | 0.1.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is a cross-account impersonation flaw within the auth-aws plugin of OpenBao, identified as GHSA-jp7h-4f3c-9rc7. The root cause is a defective caching mechanism for AWS clients (EC2 and IAM). The analysis of the patch commit 2a77af36834746ca6d3ac9bd1049154c84b3efae reveals that the client caches were indexed only by region and STS role name, critically omitting the AWS Account ID.
This created a scenario where, if two AWS accounts (one trusted, one untrusted) had IAM roles with identical names, the system could not distinguish between them in the cache. An authentication attempt from the untrusted account's role could be served a cached client belonging to the trusted account's role, leading to unauthorized access to secrets and other resources.
The primary vulnerable functions are aws.(*backend).clientEC2 and aws.(*backend).clientIAM, which were responsible for retrieving clients from this flawed cache. The patch rectifies this by restructuring the cache maps (EC2ClientsMap and IAMClientsMap) to include the accountID as part of the key, thereby ensuring that clients for roles with the same name but in different accounts are cached separately.
Additionally, the aws.(*backend).stsRoleForAccount function was modified to prevent it from implicitly using the default account's role for other accounts, adding another layer of defense against this type of impersonation.
Vulnerable functions
aws.(*backend).clientEC2auth/aws/client.go
aws.(*backend).clientIAMauth/aws/client.go
aws.(*backend).stsRoleForAccountauth/aws/client.go