Skip to content

fix(api): block SSRF in setup test-connection - #52

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-85ee
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-85ee

Conversation

@cursor

@cursor cursor Bot commented Aug 21, 2026

Copy link
Copy Markdown

Bug and impact

Authenticated POST /api/setup/test-connection passed the caller url into createClient with no host allowlist. That server-side fetch could probe loopback, RFC1918, link-local, and cloud-metadata addresses. Failures also echoed error.message, which is a reachability oracle.

Trigger: signed-in POST with {"url":"http://169.254.169.254/","key":"x"} (or http://127.0.0.1:<port>/).

Root cause

The setup wizard trusted the JSON body URL and forwarded it to supabase-js.

Fix

Allow only https hosts on supabase.co / supabase.net, or an exact origin match of NEXT_PUBLIC_SUPABASE_URL (so local self-hosted Supabase still works when configured). Reject credentials-in-URL. Return a generic 400/500 without exception text.

Tests

tests/lib/supabase-connection-url.test.ts covers cloud hosts, blocked private/metadata/DNS-rebinding-style names, and the configured-origin exception. pnpm run test:run passed (239 tests).

Open in Web View Automation 

Caller-supplied URLs were passed to supabase-js with no host allowlist,
so an authenticated POST could probe loopback, private, and metadata addresses.

Co-authored-by: esadrianno <esadrianno@gmail.com>
@vercel

vercel Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
v0-agent-kit Ready Ready Preview, v0 Aug 21, 2026 11:20am

This branch was successfully deployed

1 active deployment
Preview — c5c291a4 Deployed Aug 21, 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