Skip to content

channel/A2A/MCP config Serialize leak cohort: TelegramConfig.token and 5 siblings still plaintext (Serialize sibling of #6006) #6166

Description

@bug-ops

Description

PR #6165 (closing #6006) fixed the Serialize leak for IbctKeyConfig, IbctKey, and McpTransport by replacing derived Serialize with hand-written redacting impls. During that fix's security audit, a same-defect-class cohort was identified and intentionally scoped out: structs with a custom redacting Debug (fixed by #6005/#6004) but a derived (plaintext) Serialize on a secret field:

  • TelegramConfig.token (crates/zeph-config/src/channels.rs)
  • DiscordConfig.token / application_id (crates/zeph-config/src/channels.rs)
  • SlackConfig.bot_token / signing_secret (crates/zeph-config/src/channels.rs)
  • A2aServerConfig.auth_token (crates/zeph-config/src/channels.rs)
  • McpServerConfig.env / McpServerConfig.headers (crates/zeph-config/src/channels.rs) — the config-shape sibling of McpTransport (values here are typically vault-refs, so lower sensitivity, but same latent pattern)

Why this is harder than #6006

Unlike IbctKeyConfig/IbctKey/McpTransport (which had no serialize-to-persistence path today), these six fields do legitimately serialize to TOML via the --init wizard's config-generation step. A blanket redacting Serialize (the fix used in #6165) would corrupt generated configs by writing "[REDACTED]" into the saved TOML instead of the real value.

Expected Behavior

Each field needs per-field assessment before a fix is chosen, e.g.:

Environment

Logs / Evidence

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitybugSomething isn't workingchannelszeph-channels crate (Telegram)securitySecurity-related issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions