---
title: "Supabase redirect URLs: when a wildcard is too wide"
description: "How Supabase matches redirect URL wildcards, why ** and wide host patterns are risky in production, and an allow list that still covers preview builds."
url: "https://madsalt.tech/notes/supabase-redirect-url-wildcards/"
author: "Denys Zaichenko"
author_url: "https://madsalt.tech/about/"
language: "en"
published: 2026-11-09
---

# Supabase redirect URLs: when a wildcard is too wide

TL;DR

Supabase Auth sends users back to your app after a magic link, an OAuth sign-in, an email confirmation or a password reset, and the Redirect URLs list decides where it may send them. A wildcard there is matched as a pattern: `*` stops at a dot or a slash, `**` does not. A pattern that also matches hosts you do not control lets Auth return users, and the session in the URL, to those hosts. Keep exact URLs for production, and scope preview wildcards to your own team's subdomain.

My free [Supabase security checker](https://madsalt.tech/tools/supabase-security-check/) reads the Auth settings of a project and has two rules here: "Wildcards in redirect URLs" and "Redirect URLs over http or to localhost". Both are about the same list, and both are easy to leave wide after the first preview deploy.

## What do Supabase redirect URLs control?

When a client calls `signInWithOtp`, `signInWithOAuth` or `resetPasswordForEmail` with a `redirectTo`, Supabase Auth checks it against the Site URL and the Redirect URLs list in URL Configuration. A match is used; anything else falls back to the Site URL. After the email link or the provider round trip, the user lands on that URL with the result of the sign-in attached. So the list is an allow list of places that receive a signed-in user.

## How does Supabase match a wildcard?

From Supabase's [redirect URLs guide](https://supabase.com/docs/guides/auth/redirect-urls), read on 23 October 2026, the separators are `.` and `/`:

![Where an auth link may send a signed-in user. Three kinds of entries in the Redirect URLs list. Exact production URL: Auth link → exact URL → your app only; Wildcard scoped to your team: Auth link → your team's pattern → your previews; Wildcard over a shared host: Auth link → *.shared-host → anyone's site there.](https://madsalt.tech/charts/en/supabase-redirect-url-wildcards.svg)

*Based on Supabase's redirect URLs guide, October 2026.*

| Pattern                    | Matches                           | Does not match                   |
| -------------------------- | --------------------------------- | -------------------------------- |
| `http://localhost:3000/*`  | `/foo`, `/bar`                    | `/foo/bar`, `/foo/`              |
| `http://localhost:3000/**` | `/foo`, `/foo/bar`                | —                                |
| `*`                        | any characters except `.` and `/` | anything across a dot or a slash |
| `**`                       | any characters                    | —                                |

The guide itself recommends exact redirect URLs for the Site URL in production, and keeps `**` for local development and preview URLs.

## Why is a wide wildcard risky?

The match is on the whole URL, host included. Two patterns I see in projects are wider than they look:

- **A shared hosting domain with a host wildcard,** such as a pattern for every `*.vercel.app` or `*.netlify.app` host. Anyone can deploy a site on those platforms, so the pattern also covers sites you do not own.
- **`**` in the host part,** which crosses dots and so matches far more hosts than intended.

If an allowed URL belongs to someone else, a sign-in or reset flow can end on their page, and the session the user just created ends up there with it. That is why the checker treats a wildcard in a production project as a finding and asks you to confirm each one.

## How do you write a safe allow list?

1. Set the Site URL to your production URL, never `localhost`.
2. List production redirect URLs exactly, with their path: `https://app.example.com/auth/callback`.
3. For previews, scope the wildcard to your own team or project slug, following the provider's naming. The guide's examples are `https://*-<team-or-account-slug>.vercel.app/**` for Vercel and `https://**--my_org.netlify.app/**` for Netlify, with your own slug in place of the placeholder.
4. Keep `http://localhost:3000/**` in the local `config.toml` only, not in the hosted project.
5. Use `https` everywhere except localhost; the checker flags `http` and `localhost` entries in a hosted project.

Redirect URLs are hosted config, so they are not in your repo and are easy to forget after a launch. The other Auth settings that live only in the hosted project are in [is Supabase secure](https://madsalt.tech/blog/is-supabase-secure/), and the access rules that should hold no matter where a user lands are in my [Lovable app security checklist](https://madsalt.tech/blog/lovable-app-security-checklist/).

If you want a person to go through the whole app rather than one setting, I do a [Supabase security audit](https://madsalt.tech/services/vibe-coded-app-audit/) with a keep, fix or rewrite verdict for each part.

## My similar case

I applied the migrations of 1,170 public Supabase projects to fresh databases: of the 568 that ran cleanly, 134 (23.6%) had a table with RLS off that the public key could read and change. The method and queries are in [the open-source Supabase study](https://madsalt.tech/blog/open-source-supabase-projects-security-study/).

Not sure your redirect URLs are safe? Write to me and we'll check your auth settings.

Are your redirect URLs safe?

Tell me what you have now and what you need. I'll reply with the option I'd pick.

[Write to me](https://madsalt.tech/#contact)
