Skip to content

security: Workspace-credential sealing silently falls back to plaintext whenever alias/spore-bot-secrets is absent #1594

Closed

Description

@scttfrdmn

From the pre-1.0 security audit (spore-host/spore-host#649, 2026-11-11), audit id secrets-11. Verified: confirmed, severity low (reviewer said low).

Where: pkg/botsecret/botsecret.go:138 (at origin/main on 2026-11-11)

Evidence

botsecret.go:136-140: if err != nil && notProvisioned(keyID, err) { noticeOnce(..."stored unencrypted"...); return plaintext, nil }. notProvisioned is true for a NotFoundException on the default alias. spore-host infra/tofu/spore-bot/main.tf:273-276: aws_kms_alias count = var.seal_workspace_credentials ? 1 : 0, so setting that variable false deletes the alias.

Scenario

If the alias is removed by a tofu variable flip, an accidental delete, or a self-hosted stack without the key, every new OAuth install and token rotation writes bot tokens, refresh tokens and webhook URLs to DynamoDB in plaintext. The only signal is one log line per process. Anyone who can read the table or its backups gets live Slack tokens.

Verifier

spawn pkg/botsecret/botsecret.go:142-145 returns the plaintext with only a one-time log notice when the default alias returns NotFoundException (notProvisioned, lines 159-162). spore-host infra/tofu/spore-bot/main.tf:273-276 makes the alias conditional on var.seal_workspace_credentials. This is a deliberate rollout fallback; it fails open only under operator misconfiguration.

Suggested fix

Now that the hosted key exists, make plaintext fallback an explicit opt-in (env flag), not the default, and alarm on the 'stored unencrypted' notice.

Deployed-state check

Confirm alias/spore-bot-secrets exists in 966362334030 and that the spore-bot-workspaces table has no plaintext credential attributes (the seal sweep's stats).

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:security

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions