Skip to content

Slack allowed redirect fix#2071

Merged
robert-inkeep merged 3 commits intomainfrom
slack-allowed-redirect
Feb 17, 2026
Merged

Slack allowed redirect fix#2071
robert-inkeep merged 3 commits intomainfrom
slack-allowed-redirect

Conversation

@robert-inkeep
Copy link
Collaborator

No description provided.

@vercel
Copy link

vercel bot commented Feb 17, 2026

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

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 17, 2026 4:55pm
agents-docs Ready Ready Preview, Comment Feb 17, 2026 4:55pm
agents-manage-ui Ready Ready Preview, Comment Feb 17, 2026 4:55pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2026

🦋 Changeset detected

Latest commit: 435de2d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@inkeep/agents-work-apps Patch
@inkeep/agents-api Patch
@inkeep/agents-manage-ui Patch
@inkeep/agents-cli Patch
@inkeep/agents-core Patch
@inkeep/agents-manage-mcp Patch
@inkeep/agents-mcp Patch
@inkeep/agents-sdk Patch
@inkeep/ai-sdk-provider Patch
@inkeep/create-agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(2) Total Issues | Risk: Medium

🟠⚠️ Major (1) 🟠⚠️

🟠 1) oauth.ts Defense-in-depth regression: removal of redirect URL allowlist

Issue: This PR removes the ALLOWED_REDIRECT_HOSTNAMES allowlist validation that previously restricted OAuth callback redirects to localhost, 127.0.0.1, and *.inkeep.com domains. While the OAuth state parameter (HMAC-SHA256 signed, 10-minute TTL, nonce) remains intact and provides CSRF protection, this removal shifts the security boundary from defense-in-depth (code-enforced domain allowlist + operator-controlled env var) to operator-trust-only (env var alone).

Why: This is a defense-in-depth regression with the following implications:

  1. Not a classic open redirect — The redirect destination (INKEEP_AGENTS_MANAGE_UI_URL) is controlled by the server operator via environment variable, not by request parameters. External attackers cannot directly control where users are redirected.

  2. Operator misconfiguration risk — If an operator sets INKEEP_AGENTS_MANAGE_UI_URL to a malicious or attacker-controlled domain (via env misconfiguration, compromised CI/CD, or supply chain attack), the OAuth callback would redirect users with workspace metadata in the URL.

  3. Data exposure in redirect — The redirect URL includes safeWorkspaceData (teamId, teamName, teamDomain, botScopes, installerUserId, connectionId, etc.). While botToken is excluded, metadata exposure to an untrusted domain is still a concern.

Fix: Consider one of these mitigations based on your security posture:

Option A (Recommended) — Add runtime validation with configurable allowlist:

// New env var for custom deployments
const ALLOWED_REDIRECT_PATTERNS = env.SLACK_OAUTH_REDIRECT_ALLOWLIST
  ? env.SLACK_OAUTH_REDIRECT_ALLOWLIST.split(',')
  : ['localhost', '127.0.0.1', '.inkeep.com'];

function isAllowedRedirectUrl(url: string): boolean {
  try {
    const parsed = new URL(url);
    return ALLOWED_REDIRECT_PATTERNS.some(pattern =>
      pattern.startsWith('.') 
        ? parsed.hostname.endsWith(pattern)
        : parsed.hostname === pattern
    );
  } catch {
    return false;
  }
}

// Log warning instead of throwing to allow custom domains while maintaining visibility
if (!isAllowedRedirectUrl(manageUiUrl)) {
  logger.warn({ manageUiUrl }, 'INKEEP_AGENTS_MANAGE_UI_URL is not in default allowlist - ensure this is intentional');
}

Option B — Keep removal but add documentation and audit logging:

  • Document in .env.example that operators are responsible for securing this URL
  • Add audit log when OAuth completes with the redirect destination for incident investigation

Option C — Accept the risk explicitly:

  • If this is intentional for self-hosted/custom domain support and the operator trust model is acceptable, add a code comment explaining the security trade-off and update the changeset message to document this decision.

Refs:

🟡 Minor (1) 🟡

Inline Comments:

  • 🟡 Minor: .changeset/mighty-trains-teach.md:5 Changeset message doesn't follow project standards

💡 APPROVE WITH SUGGESTIONS

Summary: This PR accomplishes its goal of allowing custom domains for self-hosted deployments, but removes a defense-in-depth security control without adding compensating measures. The change is low-risk for Inkeep-managed deployments but creates operator-trust dependencies for self-hosted scenarios. Consider adding either a configurable allowlist or documentation clarifying the security responsibility shift to operators.

Discarded (0)
Location Issue Reason Discarded
No findings were discarded
Reviewers (2)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-security-iam 1 1 0 0 0 0 0
pr-review-standards 1 0 0 0 1 0 0
Total 2 1 0 0 1 0 0

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
@github-actions github-actions bot deleted a comment from claude bot Feb 17, 2026
@robert-inkeep robert-inkeep merged commit 2a91f04 into main Feb 17, 2026
@robert-inkeep robert-inkeep deleted the slack-allowed-redirect branch February 17, 2026 16:50
Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(0) New Issues | (1) Pending | Risk: Medium

Delta Review Summary

This is a re-review scoped to changes since the last automated review. The delta contains only:

  • .changeset/mighty-trains-teach.md — Updated from informal message to project-standard format ✅

Resolved Feedback:
The prior inline comment about the changeset message not following project standards has been addressed. The message now correctly uses an action verb and describes the change's impact on consumers.

🕐 Pending Recommendations (1)

  • 🟠 oauth.ts Defense-in-depth regression: removal of redirect URL allowlist without compensating controls

💡 APPROVE WITH SUGGESTIONS

Summary: The delta changes are clean — the author addressed the changeset message feedback. The prior MAJOR finding regarding the defense-in-depth regression in oauth.ts remains unaddressed. Consider the mitigations suggested in the previous review (configurable allowlist, documentation, or explicit risk acceptance) before shipping to production.

Discarded (0)
Location Issue Reason Discarded
No findings were discarded
Reviewers (0)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
Total 0 0 0 0 0 1 0

Note: No reviewers dispatched — delta contained only a resolved changeset message fix with no new substantive code to review.

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