Redact channel config secrets in API responses — readable by any authenticated user today #47
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#47
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ChannelRead(app/schemas/channel.py:23-32) serializesconfigverbatim.GET /api/channels/and/api/channels/{id}(app/api/channels.py:62-109)require only
require_user, andcan_view_channel(app/api/permissions.py:68-73) grants view on global channels to every role
including readonly. Config JSONB contains live secrets (Webex bot_token,
Pushover app_token/user_key, webhook Authorization headers). Net: any
authenticated user can read shared-channel credentials.
Fix: redact known secret keys per channel type in read responses (mirror the
AI provider
has_api_keypattern, app/api/ai.py); return full config only tocan_manage_channelcallers where the edit UI needs it — or never, withwrite-only semantics and empty-means-unchanged updates. Rotate exposed tokens
if other users have had accounts.
Acceptance criteria:
Filed from the 2026-07-17 codebase audit (
docs/.internal/report-2026-07-17.md), finding F-08.Fixed in #93 (merged to
main). Secret-bearing config keys are now redacted tohas_<key>indicators in list responses and for non-managers on the single GET; full config is returned only to callers who passcan_manage_channel, preserving the edit flow. Per-type secret map: webhookheaders+url(a webhook URL can embed a token), webexbot_token, pushoveruser_key/app_token, smsto_number/from_number, signalrecipients(phone numbers are treated as PII); discord/matrix keep no secrets in config. Regression tests cover readonly/non-manager redaction, list redaction for all roles, and manager full-read.