Skip to content

HC Vault / OpenBao token exfiltration when decrypting untrusted SOPS-encrypted files

High
felixfontein published GHSA-jgf3-f6rg-8x3h Aug 14, 2026

Package

gomod github.com/getsops/sops/v3 (Go)

Affected versions

*

Patched versions

None

Description

Impact

When a user asks SOPS to decrypt a file, SOPS tries first offline and then online identities specified in the encrypted file's metadata to decrypt the file's secret key. If the metadata contain a HashiCorp Vault key (hc_vault), and SOPS can find a token, it will contact the vault_address provided in the metadata with the user's token in the X-Vault-Token HTTP header. SOPS will look for a token in ~/.vault-token, and HashiCorp Vault's client will look for a token in the VAULT_TOKEN environment variable if SOPS does not provide one.

So if a user has a Vault token set up in ~/.vault-token or VAULT_TOKEN, and decrypts an attacker-provided SOPS-encrypted file that contains a malicious vault_address value, SOPS will exfiltrate the token by sending it to the server provided in vault_address.

Patches and mitigations

In SOPS < 3.13.0, the best mitigation is to have a file ~/.vault-token that contains an invalid token. This unfortunately prevents SOPS from decrypting any file that requires a Vault / OpenBao server to decrypt it.

SOPS 3.13.0 introduces a new environment variable SOPS_HC_VAULT_ALLOWLIST that configures which Vault / OpenBao servers SOPS is allowed to contact:

  • When set to all, there is no restriction. This is the same behavior as for SOPS < 3.13.0, and currently the default value.
  • When set to none, SOPS will never contact a Vault / OpenBao server to decrypt a file.
  • When set to a comma-separated URL of host prefixes, like https://vault.example.com:1234, https://secrets.example.org/, SOPS will only contact Vault / OpenBao servers specified in vault_address that start with one of the listed prefixes. Note that the prefix https://vault.example.com:123 does not match https://vault.example.com:1234, and https://vault.example.co does not match https://vault.example.com.

We strongly recommend to upgrade to SOPS 3.13.0 or newer, and to set SOPS_HC_VAULT_ALLOWLIST as restrictively as possible.

Future versions of SOPS will eventually change the default to none, without waiting for a new major release 4.0.0. So if you do use Vault / OpenBao to encrypt and decrypt files, make sure to set SOPS_HC_VAULT_ALLOWLIST explicitly.

References

For more information

If you have any questions or comments about this advisory:

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

CVE ID

No known CVE

Weaknesses

Insufficiently Protected Credentials

The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. Learn more on MITRE.

Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination. Learn more on MITRE.

Credits