Skip to content

Channel-privacy check fails open on getChannelInfo null (pre-existing) #3003

Closed

Description

@bokelley

Flagged during PR #3000 security review.

Problem

All seven channel-setting PUT endpoints in `server/src/routes/admin/settings.ts` guard the is-private requirement like:

```ts
if (isSlackConfigured()) {
const channelInfo = await getChannelInfo(channel_id);
if (channelInfo && !channelInfo.is_private) { reject }
}
```

When `getChannelInfo` returns `null` (bot missing from channel, Slack API throttled, 5xx, wrong scopes), the `channelInfo && ...` short-circuit skips the check and the write is accepted.

For the private-required endpoints (billing/escalation/admin/prospect/error/editorial) this is caught downstream by `sendChannelMessage(..., { requirePrivate: true })` at post time — review/sensitive content cannot leak to a public channel.

For the announcement endpoint (inverted, rejects private), the fail-open direction is the opposite: a `null` lets through a private channel id, producing a configuration state that looks valid but silently misroutes.

Proposed

Treat `null` from `getChannelInfo` as reject-with-explanation, not accept, across all seven endpoints. Preserve the local-dev "no bot token" escape hatch by only failing closed when `isSlackConfigured()` is true.

Scope

Pre-existing across all seven endpoints; out of scope for #3000.

Activity

  1. bokelley commented on Apr 24, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Bug
    Bucket(s): admin / ops tools, security-sensitive (no security-sensitive label exists in repo — noted)
    Status: ready-for-human

    What the experts said:

    • security-reviewer: Downstream requirePrivate: true gate fully mitigates exposure on six private-required endpoints; announcement endpoint has no downstream gate, so a null return silently accepts a private channel ID and misroutes member-facing posts. Fix is sound — fail-closed on null with a "couldn't verify (retry)" vs. "confirmed public (pick another channel)" distinction in the error message. No specialist review needed before shipping.

    My take: Real exposure risk is low — these are admin-only endpoints and the downstream safety net covers 6 of 7 channels. The security reviewer cleared the approach for immediate execution. Flagging because the bucket requires a human gate, not because the change is uncertain.

    @bokelley, your call: approve a draft PR (7 fail-closed changes + improved null error messages) or handle directly.


    Triaged by Claude Code. Session: https://claude.ai/code/cse_016DwcMx1RDQ8HWxp2jKAQTF


    Generated by Claude Code

  2. added
    bug
    claude-triaged
    on Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclaude-triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions