Skip to content

fix(databricks): send workspace tokens only to Databricks workspace hosts - #8362

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/databricks-validate-workspace-host
Sep 28, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/databricks-validate-workspace-host

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Every Databricks tool built its request URL from the user-supplied workspace host without checking it was a Databricks workspace, so the workspace token went to whatever host was entered. The executor's DNS and pinned-IP guard already blocks private targets; this closes the rest
  • All 26 Databricks tools (12 original, 14 Genie) now build their URL through databricksUrl, which runs the same validateDatabricksWorkspaceHost allowlist the Databricks KB connector uses and builds from the sanitized https origin. Request paths, methods, headers, and bodies are unchanged
  • The allowlist gains .cloud.databricks.mil (AWS GovCloud DoD workspaces) and .databricks.com (Databricks custom workspace URLs), so no workspace host that worked before is refused. http:// hosts keep being upgraded to https
  • validateVendorHostedUrl strips a single trailing FQDN dot before the suffix check and builds the URL from the dotless host. A trailing-dot host now connects: Bun's TLS check rejects the dotted name. This applies to Databricks, ServiceNow, and Workday; hosts without a trailing dot are unchanged
  • Responds to a review thread on v0.9.4: db contention fixes, databricks genie, snowflake cortex, additional search connectors #8356

Type of Change

  • Bug fix

Testing

  • tools/databricks/databricks.test.ts: foreign and lookalike hosts are refused by all 26 tools before any request. The accepted host forms (bare, https, http, trailing slash, whitespace, AWS, GovCloud, DoD, GCP, Azure, Azure Gov, Azure China, a custom URL) build the same URLs the old tools built, and trailing-dot hosts build a dotless URL. The refusal, .mil, custom-URL, and trailing-dot cases fail on staging
  • Databricks, ServiceNow, and Workday tool and connector suites, plus input-validation suites (263 tests), type-check, lint, and check:audits pass

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 28, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 28, 2026 1:29am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Critical risk] Adds host validation to Databricks API calls.

The PR appears safe to merge; no outstanding findings or new actionable issues were identified.

Summary

The PR routes Databricks tool URLs through workspace-host validation and normalizes trailing-dot vendor hosts.

  • It extends the Databricks allowlist for DoD and custom workspace domains.
  • It adds host-refusal and URL-form regression tests.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Workspace host input] --> B[Databricks URL helper]
  B --> C[Validate and normalize host]
  C -->|Allowed| D[Build HTTPS API URL]
  C -->|Refused| E[Return tool error]
  D --> F[Tool request]
Loading

Reviews (2) · Last reviewed commit: "test(databricks): assert every tool refu..."

Comment thread apps/sim/tools/databricks/databricks.test.ts Outdated
Comment thread apps/sim/tools/databricks/databricks.test.ts Outdated

@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 16 files

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

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/core/security/input-validation.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 28, 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 16 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 3896437 into staging Sep 28, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/databricks-validate-workspace-host branch September 28, 2026 02:06

This branch was previously deployed

1 inactive deployment
Preview — 77f37132 Deployed Sep 28, 2026 by vercel[bot]
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