Apr 21, 2026·6 min read·3 visits
A logical error in OpenBao's auth/cert backend allows attackers with a valid token and a same-CA certificate to bypass identity checks and renew tokens they do not own, extending unauthorized access.
OpenBao versions prior to 2.5.3 contain an authentication bypass vulnerability within the Certificate Authentication (auth/cert) method. A flaw in the token renewal logic allows an attacker possessing a valid token and any certificate signed by the same Certificate Authority to improperly renew the token, circumventing intended identity boundaries.
OpenBao utilizes the auth/cert backend to authenticate clients using TLS client certificates. This mechanism maps verified certificates to specific OpenBao policies and issues corresponding access tokens. The vulnerability resides within the token renewal phase of this authentication method, specifically affecting deployments that configure roles with the disable_binding=true parameter.
The core issue is a manifestation of CWE-287 (Improper Authentication). During the renewal of an existing token, the system fails to adequately verify that the certificate presented over the mTLS connection matches the specific client identity that originally generated the token. This failure occurs because the validation logic relies on overly broad identifiers rather than cryptographic proof of the exact certificate.
As a result, an attacker can extend the lifetime of a token indefinitely. If the attacker obtains a target token or its accessor, they can present their own valid certificate to the renewal endpoint. Provided their certificate is signed by the same Certificate Authority (CA) as the original certificate, the system processes the renewal request and extends the victim's session.
The vulnerability originates from insecure identity comparison logic implemented within the pathLoginRenew function. When a client initially authenticates, OpenBao extracts metadata from the provided certificate. In vulnerable versions, the system recorded the Subject Key Identifier (SKID) and the Authority Key Identifier (AKID) within the token's internal data structure.
During token renewal, the system evaluated the incoming mTLS certificate against this stored metadata. The code utilized a logical AND (&&) condition to determine if the presented certificate failed to match the original identity. The mismatch condition required both the SKID and the AKID to differ from the stored values to trigger an authentication error.
This logical structure introduces a critical flaw due to the nature of X.509 certificate fields. The AKID identifies the specific CA that issued the certificate. Consequently, all certificates issued by a given CA share the identical AKID. When an attacker presents a different certificate signed by the same CA, the AKID matches the stored value.
Because the AKID matches, the second half of the mismatch condition evaluates to false. The logical AND operation then resolves to false overall, causing the system to bypass the mismatch error entirely. The code proceeds under the false assumption that the client identity has been successfully verified, ignoring the fact that the SKID (which identifies the specific client) is completely different.
An examination of the vulnerable code reveals the direct implementation of the logical flaw. The system extracted the SKID and AKID strings from the token's InternalData and compared them against the incoming connection state. The error logic was constructed to return an access denial only if both identifiers mismatched simultaneously.
// Conceptual vulnerable logic
if req.Auth.InternalData["subject_key_id"] != skid && req.Auth.InternalData["authority_key_id"] != akid {
return nil, errors.New("client identity during renewal not matching original identity")
}The remediation, introduced in commit 9ab7a066826cc544c30e8b203f8f472076f366e1, completely restructures this validation approach. The patch eliminates the reliance on SKID and AKID strings. Instead, during the initial login phase, the backend now captures the raw byte representation of the client certificate, base64-encodes it, and stores it directly within the token's InternalData under the `
Exploitation of this vulnerability requires the attacker to satisfy a specific set of prerequisites. First, the attacker must possess the victim's valid token or the corresponding token accessor. Second, the attacker must hold a valid TLS certificate, along with its private key, that is signed by the same Certificate Authority trusted by the target OpenBao instance.
The target environment must also be configured in a specific manner. The certificate role associated with the victim's token must have the disable_binding=true parameter set. Alternatively, the role must lack strict network or identity bindings that would otherwise reject the attacker's connection based on IP address or common name constraints.
The attack execution is straightforward once the prerequisites are met. The attacker initiates a standard mTLS connection to the OpenBao API, specifically targeting the certificate authentication renewal endpoint. They establish the TLS handshake using their own valid certificate but include the victim's OpenBao token in the X-Vault-Token HTTP header.
The vulnerable backend processes the request, authenticates the TLS session using the CA trust store, and triggers the flawed identity comparison logic. Because the attacker's certificate shares the same AKID as the victim's certificate, the system extends the lease of the victim's token. The attacker can repeat this process indefinitely to maintain persistent access.
The primary security impact is the unauthorized extension of access privileges. By continually renewing the token, an attacker forces the token to persist beyond its intended time-to-live (TTL). This grants the attacker prolonged access to any static secrets, dynamic credentials, or cloud access keys associated with that specific token.
The vulnerability is constrained by the initial privilege level of the stolen token. The attacker does not achieve vertical privilege escalation; they cannot perform actions outside the policies attached to the original identity. The attack is confined to the specific role and namespace defined during the victim's initial authentication event.
This flaw is categorized with a CVSS 4.0 score of 2.0 (Low). The low severity reflects the stringent attack prerequisites. An attacker must possess an already-valid certificate from the trusted internal CA and must have independently compromised the victim's token material. Without these elements, the vulnerability cannot be triggered.
It is important to recognize that OpenBao inherited this vulnerability from the upstream HashiCorp Vault codebase. Organizations that have migrated from vulnerable versions of Vault to OpenBao will carry this inherited risk forward. Security teams must ensure their OpenBao deployments are explicitly patched, regardless of the security posture of their previous infrastructure.
The definitive remediation for CVE-2026-39388 is to upgrade OpenBao to version 2.5.3 or later. This release implements the strict byte-for-byte certificate comparison logic and introduces cryptographic roleData binding. These changes fundamentally eliminate the logical flaw present in the legacy identity validation routine.
Administrators operating environments where immediate patching is unfeasible must implement configuration workarounds. Security teams should audit all certificate roles and enforce tight scoping. Privileged roles should utilize strict allowed_common_names, allowed_dns_sans, or allowed_email_sans directives to restrict authentication to highly specific certificate attributes.
The disable_binding parameter must be evaluated across all roles. Unless specific network topology constraints mandate its use, disable_binding should be set to false. Enforcing strict identity and network binding prevents valid certificates from traversing network boundaries and limits the utility of a stolen token.
Detection of exploitation attempts requires proactive auditing. Defenders can utilize the sys/auth/token/lookup-accessor API endpoint to inspect the internal metadata of active tokens. Tokens issued by the auth/cert backend that lack the certificate key in their InternalData structure were generated by unpatched logic and indicate that the deployment requires remediation.
CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenBao OpenBao | < 2.5.3 | 2.5.3 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-287 |
| Attack Vector | Network |
| CVSS 4.0 | 2.0 (Low) |
| EPSS Score | 0.00032 |
| Impact | Unauthorized Token Lifetime Extension |
| Exploit Status | none |
| CISA KEV | No |
Improper Authentication logic allows an attacker to bypass intended identity checks during the token renewal phase.