sealed-env Unseal Token TOTP/Enterprise Secret Disclosure (CVE-2026-45091)
by HORKimhab · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-45091
- Category
- crypto
- Affected product
- sealed-env (davidalmeidac/sealed-env) — unseal token mechanism
- Affected versions
- Per source repository / referenced GHSA-x3r2-fj3r-g5mv advisory
- Disclosed
- 2026-07-05
- Patch status
- unpatched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-07 |
| Author / Researcher | HORKimhab |
| CVE / Advisory | CVE-2026-45091 |
| Category | crypto |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | jwt, sealed-env, totp, secret-disclosure, base64, token-forgery |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | sealed-env (davidalmeidac/sealed-env) — unseal token mechanism |
| Versions Affected | Per source repository / referenced GHSA-x3r2-fj3r-g5mv advisory |
| Language / Platform | Bash + Node.js (PoC scripts); JWT-like token format (target) |
| Authentication Required | No — requires only possession of a captured unseal token |
| Network Access Required | No (offline token decoding) |
Summary
sealed-env’s “unseal token” is structured like a JWT (header.payload.signature) but its payload embeds sensitive material — specifically a totpSecret / enterpriseSecret field — in plain base64url-encoded JSON with no additional protection beyond the (unverified by this PoC) signature. Anyone who obtains an unseal token (e.g. via logs, network capture, or a leaked artifact) can trivially base64url-decode the payload segment and recover the embedded TOTP/enterprise secret, which combined with the master key allows generation of unlimited valid unseal tokens.
Vulnerability Details
Root Cause
The unseal token’s payload segment is base64url-encoded JSON containing a totpSecret/enterpriseSecret value that is not encrypted — only encoded — and is therefore recoverable by anyone with the raw token string, without needing to know the signing key or bypass any cryptographic control.
Attack Vector
- Attacker obtains a captured/leaked
sealed-envunseal token (e.g. from logs, CI artifacts, browser storage, or network traffic). - Attacker splits the token on
.and takes the second (payload) segment. - Attacker base64url-decodes the payload segment to recover the JSON body.
- Attacker extracts the
totpSecretorenterpriseSecretfield directly from the decoded JSON. - With this secret (and the master key, if also available), the attacker can generate unlimited valid unseal tokens, undermining the sealing scheme’s intended one-time/limited-use guarantees.
Impact
Disclosure of the TOTP/enterprise secret embedded in unseal tokens allows an attacker to forge additional valid unseal tokens, potentially bypassing the intended access controls of the sealed-env secret management flow.
Environment / Lab Setup
Target: Any sealed-env deployment issuing JWT-style unseal tokens with
an embedded totpSecret/enterpriseSecret claim.
Attacker tooling: bash + jq (for the shell PoC), or Node.js (for the
JS PoC) — a captured unseal token string is required.
Proof of Concept
PoC Script
See
poc-cve-2026-45091.shandextract-totp.jsin this folder.
| |
Running either script against a captured unseal token base64url-decodes the JWT payload and prints the embedded totpSecret/enterpriseSecret value in plain text, demonstrating that the secret is recoverable without any cryptographic attack.
Detection & Indicators of Compromise
- Unseal tokens appearing in logs, error messages, CI/CD output, or
browser storage/network traces where they should not be exposed.
- Repeated unseal operations from unfamiliar IPs/clients shortly after
a token has appeared in an accessible location (log aggregator, etc.).
Signs of compromise:
- Unseal tokens or their decoded payloads present in centralized logging systems.
- Unexpected/unauthorized unseal token generation activity.
- TOTP/enterprise secret values found in plaintext in captured artifacts.
Remediation
| Action | Detail |
|---|---|
| Primary fix | Update sealed-env to a version that encrypts (not just base64-encodes) sensitive claims such as totpSecret/enterpriseSecret within the unseal token payload, per the referenced advisory. |
| Interim mitigation | Rotate all TOTP/enterprise secrets and master keys, avoid logging or persisting raw unseal tokens, and restrict where unseal tokens are transmitted/stored (e.g. redact from logs, use short-lived tokens). |
References
Notes
Mirrored from https://github.com/HORKimhab/CVE-2026-45091 on 2026-07-05.
| |