/

CVE-2026-45091

Severity:

CRITICAL RISK

(9.1)

Sensitive Information Exposure in sealed-env Enterprise

CVE-2026-45091

Deferred

Vulnerability type

Category:

Sensitive Information Exposure

CWE:

CWE-200, CWE-522

Impact:

Authentication Secret Disclosure and Privilege Compromise

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

sealed-env enterprise mode versions 0.1.0-alpha.1 through 0.1.0-alpha.3 embed the operator's TOTP secret directly in the JWS payload of every unseal token, which is only base64-encoded, not encrypted.

Any party who can observe a minted unseal token in logs, environment variables, or monitoring tools can decode it and recover the TOTP secret, potentially bypassing zero-trust assumptions and taking over secret management workflows.

Affected context

This vulnerability appears in sealed-env when:

  • Enterprise mode is enabled and unseal tokens are minted for operators or automation.
  • Tokens are handled across CI/CD pipelines, orchestration systems, or observability tooling.
  • JWS payloads are treated as opaque "tokens" and may be logged, inspected, or exposed via environment variables or API responses.

Because the JWS payload is only base64-encoded JSON, any location where these tokens are exposed can become a source of TOTP secret disclosure.

Exploit preconditions

  • Attack surface: Any channel where unseal tokens may be observed:
  • CI build logs
  • Container environment variable dumps
  • kubectl describe output
  • Application logs and error traces (e.g., Sentry/Rollbar)
  • Log aggregation and monitoring backends
  • Required access: Ability to read or intercept unseal tokens from these channels (e.g., CI logs access, cluster read privileges, log platform access).
  • Trigger point: The moment a vulnerable sealed-env instance mints an unseal token and it is exposed through logging, configuration, or monitoring.
  • Why exploitation is possible: The operator's TOTP secret is embedded directly and persistently in every token's JWS payload in plaintext JSON (only base64-encoded), so any observer can decode and reuse it, undermining the intended zero-trust design.

Why this happens

The core defect is an insecure design choice where a long-lived, high-value authentication secret (the operator's TOTP secret) is embedded directly into a short-lived token artifact.

The JWS structure provides integrity but not confidentiality: its payload is base64-encoded JSON by default, not encrypted. Treating JWS encoding as if it provided secrecy led to exposure of sensitive authentication material.

This maps to:

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, because confidential secrets are made available in token payloads that are likely to be logged or shared.
  • CWE-522: Insufficiently Protected Credentials, because credential material is not adequately protected in transit or at rest within application artifacts, and relies on obscurity (base64) rather than cryptographic confidentiality.

Potential impact

  • An attacker may recover the operator's TOTP secret and generate valid authentication codes indefinitely.
  • An attacker could bypass multi-factor/unseal protections built around sealed-env, effectively impersonating a privileged operator or automation identity.
  • An attacker may gain long-term control over secret management flows, including the ability to unseal vaults, rotate or read secrets, and modify security posture.
  • Compromise of one observable token could lead to cross-environment impact if the same TOTP secret is reused.
  • Incidents in CI/CD or logging infrastructure could escalate into full environment compromise via stolen TOTP secrets.

General mitigation guidance

Mitigation focuses on treating high-value secrets as never-exported, never-embedded credentials, and on minimizing where and how tokens carry sensitive data.

Recommended defensive patterns include:

  • Designing tokens to carry only minimally necessary, non-secret metadata (e.g., subject identifiers, scopes, expiration) and deriving trust from server-side state or key material, not embedded secrets.
  • Separating authentication factors from transport artifacts: TOTP seeds, private keys, or master secrets should remain confined to secure storage layers and not be serialized into tokens at all.
  • Using cryptographic mechanisms aligned with the desired property:
  • For confidentiality, combine JWS with proper encryption (e.g., JWE) or equivalent mechanisms, rather than relying on base64 encoding.
  • For integrity only, keep payloads non-sensitive so leakage does not expose credentials.
  • Implementing strict logging and tracing hygiene:
  • Avoid logging complete tokens in application or infrastructure logs.
  • Redact or truncate token fields when observability is necessary.
  • Applying least-privilege and compartmentalization in secret management:
  • Limit who and what can mint unseal tokens.
  • Scope tokens narrowly (short TTLs, minimal permissions) so exposure has reduced blast radius.

How teams detect issues like this

Effective detection is primarily about identifying both the insecure design pattern and accidental exposure of sensitive tokens:

  • Static analysis and code review:
  • Flag any code paths that embed raw secrets (TOTP seeds, keys, passwords) into token payloads, headers, or cookies.
  • Review JWS/JWT/JWE usage to distinguish between integrity-only and confidentiality-providing mechanisms; ensure sensitive data is never stored in cleartext payloads.
  • Look for serialization of authentication secrets into JSON structures passed to signing routines.
  • Configuration and policy enforcement:
  • Enforce coding standards or lint rules that prohibit logging full tokens or credentials.
  • Apply security review checklists for secret management components to ensure credentials are never embedded into transport artifacts.
  • Operational monitoring:
  • Scan logs and telemetry for base64-encoded JSON tokens in contexts likely to hold secrets, and verify that decoded payloads do not include credential-like fields (e.g., totp_secret, seed, secretKey).
  • Use automated tooling or DLP policies to detect probable secrets in structured logs and configuration snapshots.
  • Automated review tools:
  • Integrate secret-scanning and token-inspection tools in CI pipelines to flag accidental inclusion of secrets in token payloads or logged output.

Sources

SourceLink
github.comgithub.com/davidalmeidac/sealed-env/security/advisories/GHSA-x3r2-fj3r-g5mv

Frequently asked

questions

Exploitability is high wherever unseal tokens are visible beyond a tightly controlled boundary. Any user or system with access to CI logs, cluster descriptions, observability dashboards, or log archives that contain these tokens can decode the payload and recover the TOTP secret. Once obtained, the secret allows ongoing generation of valid TOTP codes, making exploitation both practical and impactful.

An attacker needs read access to any medium where vulnerable unseal tokens appear. This could be as simple as having read-only permissions to CI build logs, observability platforms, shared debugging tools, or cluster metadata outputs. No direct access to the sealed-env host or its configuration is required if tokens are already exposed in those channels.

The safest pattern is to ensure that high-value secrets (such as TOTP seeds, private keys, or master credentials) never leave their secure storage boundary and are never embedded in tokens. Tokens should contain only non-sensitive identifiers and claims, with trust derived from server-held key material and strict validation. Where confidentiality is required, use proper encryption (e.g., JWE or equivalent) and avoid relying on base64 encoding or integrity-only signatures for secret protection.

Prevention depends on a secure-by-design approach to token and credential handling:

  • Clearly distinguish between data that requires confidentiality and data that only needs integrity, and choose mechanisms accordingly.
  • Adopt internal design rules that forbid embedding raw secrets in tokens, URLs, logs, or client-visible artifacts.
  • Include security reviews focused on secret management and token design in the architecture and code review process.
  • Implement automated checks (linters, secret scanners, policy-as-code) that detect and block patterns where credentials are serialized into payloads or logged.
Find out what's already
exploitable in your codebase.