Skip to content

fix(slack): harden native webhook configuration - #7566

Merged
waleedlatif1 merged 4 commits into
stagingfrom
codex/harden-slack-webhook-config
Sep 7, 2026
Merged

fix(slack): harden native webhook configuration#7566
waleedlatif1 merged 4 commits into
stagingfrom
codex/harden-slack-webhook-config

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • require native Slack webhook requests and verification challenges to pass signature verification
  • prevent native Slack trigger deployment when the signing secret is unavailable without affecting custom bots or outbound OAuth
  • fail closed for malformed legacy Slack webhook registrations that lack their required signing secret
  • align self-hosted setup diagnostics with runtime handling of empty secrets and document Slack's approval-gated scopes

Type of Change

  • Bug fix

Testing

  • 220 targeted Vitest tests
  • bun run lint
  • bun run check:audits
  • bun run docs-manifest:check
  • app, docs, and setup type-checks
  • selector boundary validation

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 7, 2026 7:56pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR hardens native Slack webhook configuration and authentication while preserving custom-bot and outbound OAuth behavior.

  • Verifies Slack signatures before handling URL-verification challenges or dispatching native events.
  • Prevents native Slack trigger deployment when the signing secret is absent or empty.
  • Makes legacy Slack webhook registrations without signing secrets fail closed.
  • Aligns self-hosted diagnostics and documentation with runtime configuration requirements.

Confidence Score: 5/5

The PR appears safe to merge; the webhook authentication and configuration guards are consistently applied and covered by targeted tests.

No actionable new defects remain. The previous setup-diagnostic finding was fixed by naming both extended-scope flags in the remediation and was manually resolved after waleedlatif1 confirmed the change.

Important Files Changed

Filename Overview
apps/sim/app/api/webhooks/slack/route.ts Moves native Slack signing-secret and signature checks ahead of challenge handling and event dispatch.
apps/sim/lib/webhooks/deploy.ts Rejects native Sim-app trigger deployment without a signing secret while leaving custom-bot resolution unaffected.
apps/sim/lib/webhooks/providers/slack.ts Makes malformed legacy Slack registrations without signing secrets fail closed.
apps/sim/lib/webhooks/slack-native-config.ts Centralizes normalization of the native Slack signing secret, treating empty and whitespace-only values as unconfigured.
packages/sim-setup/src/checks.ts Adds configuration coherence diagnostics and complete remediation guidance for native Slack trigger flags.
apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx Documents native Slack configuration requirements, approval-gated scopes, and outbound-only OAuth behavior.

Sequence Diagram

sequenceDiagram
  participant Slack
  participant Route as Native Slack webhook route
  participant Config as Slack native configuration
  participant Verify as Signature verifier
  participant Dispatch as Webhook dispatcher

  Slack->>Route: POST raw request
  Route->>Config: Read and trim signing secret
  alt Secret missing or empty
    Route-->>Slack: 500 Slack app not configured
  else Secret configured
    Route->>Verify: Verify timestamp, signature, and raw body
    alt Signature invalid
      Verify-->>Slack: 401 Unauthorized
    else Signature valid
      alt URL verification challenge
        Route-->>Slack: Signed challenge response
      else Slack event
        Route->>Dispatch: Resolve and dispatch webhook
        Dispatch-->>Slack: Dispatch response
      end
    end
  end
Loading

Reviews (5): Last reviewed commit: "fix(slack): align setup checks with runt..." | Re-trigger Greptile

Comment thread packages/sim-setup/src/checks.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx Outdated
Comment thread packages/sim-setup/src/checks.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the codex/harden-slack-webhook-config branch from d52a174 to 0682df9 Compare September 7, 2026 19:54
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 599654b into staging Sep 7, 2026
31 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/harden-slack-webhook-config branch September 7, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant