The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: stricter validation of returnTo path (#29288)
Etienne Stalmansd171a0238138
diff --git a/apps/studio/lib/gotrue.ts b/apps/studio/lib/gotrue.tsindex c09db08b892..efcde694edd 100644--- a/apps/studio/lib/gotrue.ts+++ b/apps/studio/lib/gotrue.ts@@ -64,7 +64,11 @@ export const getReturnToPath = (fallback = '/projects') => {// if no error, returnTo is a valid URL and NOT an internal pagevalidReturnTo = fallback} catch (_) {- validReturnTo = returnTo+ // check returnTo doesn't try trick the browser to redirect+ // don't try sanitize, it is a losing battle. Go to fallback+ // disallow anything that starts with /non-word-char+/ or non-char+/+ const pattern = /^\/?[\W]+\//+ validReturnTo = pattern.test(returnTo) ? fallback : returnTo}return validReturnTo + (remainingSearchParams ? `?${remainingSearchParams}` : '')