fix(auth): accept uppercase UUIDs in validateUUID - #2467
Conversation
mandarini
left a comment
There was a problem hiding this comment.
@i-anubhav-anand thanks for this fix. Can you please rebase your PR so that it will trigger the suite and we can merge?
266ebc1 to
23ccf69
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughUpdated Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks! I've pushed a fresh commit to retrigger CI ( |
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
…tion (#1656) ## Summary `uuidRegex` in `packages/supabase_common/lib/src/uuid.dart` only matched lowercase hexadecimal characters, so `validateUuid` rejected otherwise valid uppercase or mixed-case UUID strings. UUIDs are case-insensitive per RFC 9562/4122, and such identifiers are commonly returned by external identity providers and databases. This affects `GoTrueAdminOAuthApi.getClient`, `updateClient`, `deleteClient` and `regenerateClientSecret`, which validate the client id before issuing the request. ## Changes - `packages/supabase_common/lib/src/uuid.dart` — pass `caseSensitive: false` to the UUID `RegExp`. - `packages/gotrue/test/src/helper_test.dart` — flip the uppercase test from rejecting to accepting, add a mixed-case case, and update the `uuidRegex` case test. Non-hexadecimal characters such as `G` are still rejected. ## Outcome Implemented. ## Reference - supabase-js PR supabase/supabase-js#2467 (commit e138184574b9a0f092508ee8d961006c8550b9a8) Fixes #1649 ## Compliance matrix No change needed. The fix is internal to an existing helper and adds no public symbols; the capabilities it affects (`auth.oauth_admin.get_client`, `auth.oauth_admin.update_client`, `auth.oauth_admin.delete_client`, `auth.oauth_admin.regenerate_client_secret`) are already `implemented` in `sdk-compliance.yaml`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * UUID validation now accepts uppercase and mixed-case hexadecimal characters. * UUID format matching is consistently case-insensitive. <!-- end of auto-generated comment: release notes by coderabbit.ai --> SDK-1424
This PR updates `@supabase/supabase-js` to v2.112.3. **Source**: manual --- ## Release Notes ## v2.112.3 ## 2.112.3 (2026-08-11) ### 🩹 Fixes - **supabase:** add trace context headers to canonical CORS allow-list ([#2603](supabase/supabase-js#2603)) - **supabase:** improve trace propagation sampling and diagnostics ([#2604](supabase/supabase-js#2604)) ### ❤️ Thank You - Katerina Skroumpelou @mandarini ## v2.112.2 ## 2.112.2 (2026-08-06) ### 🩹 Fixes - **realtime:** prevent duplicate on bindings ([#2594](supabase/supabase-js#2594)) - **realtime:** clear stale join payload on sign-out ([#2597](supabase/supabase-js#2597)) ### ❤️ Thank You - Filipe Cabaço @filipecabaco - Vaibhav @7ttp ## v2.112.1 ## 2.112.1 (2026-08-05) ### 🩹 Fixes - **auth:** preserve 5xx error message ([#2587](supabase/supabase-js#2587)) - **realtime:** ensure setAuth doesn't disable token refresh ([#2592](supabase/supabase-js#2592)) ### ❤️ Thank You - Eduardo Gurgel - Vaibhav @7ttp ## v2.112.0 ## 2.112.0 (2026-08-03) ### 🚀 Features - **supabase:** move OpenTelemetry tracing to opt-in /tracing subpath ([#2583](supabase/supabase-js#2583)) ### 🩹 Fixes - **auth:** accept uppercase UUIDs in validateUUID ([#2467](supabase/supabase-js#2467)) - **postgrest:** honour throwOnError when maybeSingle finds multiple rows ([#2580](supabase/supabase-js#2580)) - **storage:** resolve createSignedUrls return type mismatch ([#2474](supabase/supabase-js#2474)) - **storage:** expose service error code on StorageApiError ([#2537](supabase/supabase-js#2537)) - **supabase:** forward db retry option ([#2571](supabase/supabase-js#2571)) ### ❤️ Thank You - Anubhav Anand @i-anubhav-anand - Gourab Singha @gourabsingha1 - Juhef @juheff - Katerina Skroumpelou @mandarini - Thribhuvan - Vaibhav @7ttp - Zuhef Ahmed @Zuhef This PR was created automatically. Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
This PR updates @supabase/*-js libraries to version 2.112.3. **Source**: manual **Changes**: - Updated @supabase/supabase-js to 2.112.3 - Updated @supabase/auth-js to 2.112.3 - Updated @supabase/realtime-js to 2.112.3 - Updated @supabase/postgest-js to 2.112.3 - Refreshed pnpm-lock.yaml --- ## Release Notes ## v2.112.3 ## 2.112.3 (2026-08-11) ### 🩹 Fixes - **supabase:** add trace context headers to canonical CORS allow-list ([#2603](supabase/supabase-js#2603)) - **supabase:** improve trace propagation sampling and diagnostics ([#2604](supabase/supabase-js#2604)) ### ❤️ Thank You - Katerina Skroumpelou @mandarini ## v2.112.2 ## 2.112.2 (2026-08-06) ### 🩹 Fixes - **realtime:** prevent duplicate on bindings ([#2594](supabase/supabase-js#2594)) - **realtime:** clear stale join payload on sign-out ([#2597](supabase/supabase-js#2597)) ### ❤️ Thank You - Filipe Cabaço @filipecabaco - Vaibhav @7ttp ## v2.112.1 ## 2.112.1 (2026-08-05) ### 🩹 Fixes - **auth:** preserve 5xx error message ([#2587](supabase/supabase-js#2587)) - **realtime:** ensure setAuth doesn't disable token refresh ([#2592](supabase/supabase-js#2592)) ### ❤️ Thank You - Eduardo Gurgel - Vaibhav @7ttp ## v2.112.0 ## 2.112.0 (2026-08-03) ### 🚀 Features - **supabase:** move OpenTelemetry tracing to opt-in /tracing subpath ([#2583](supabase/supabase-js#2583)) ### 🩹 Fixes - **auth:** accept uppercase UUIDs in validateUUID ([#2467](supabase/supabase-js#2467)) - **postgrest:** honour throwOnError when maybeSingle finds multiple rows ([#2580](supabase/supabase-js#2580)) - **storage:** resolve createSignedUrls return type mismatch ([#2474](supabase/supabase-js#2474)) - **storage:** expose service error code on StorageApiError ([#2537](supabase/supabase-js#2537)) - **supabase:** forward db retry option ([#2571](supabase/supabase-js#2571)) ### ❤️ Thank You - Anubhav Anand @i-anubhav-anand - Gourab Singha @gourabsingha1 - Juhef @juheff - Katerina Skroumpelou @mandarini - Thribhuvan - Vaibhav @7ttp - Zuhef Ahmed @Zuhef ## v2.111.0 ## 2.111.0 (2026-07-28) ### 🚀 Features - **auth:** store PKCE verifiers in per-flow slots to survive overlapping flows ([#2569](supabase/supabase-js#2569)) ### ❤️ Thank You - Katerina Skroumpelou @mandarini This PR was created automatically. Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
🔍 Description
What changed?
validateUUID()checked its input againstUUID_REGEX, which lacked the case-insensitive (i) flag:As a result, any UUID containing uppercase hex (e.g.
123E4567-E89B-12D3-A456-426614174000) was rejected client-side withExpected parameter to be UUID but is not, before the request was ever sent — even though the value is a perfectly valid UUID and the GoTrue server accepts it.This affects the public admin methods that validate a UUID argument:
getUserById,updateUserById,deleteUser,_listFactors,_deleteFactor,_adminListPasskeys,_adminDeletePasskey.Why was this change needed?
UUIDs are case-insensitive on input. Per RFC 9562 §4 (and RFC 4122 §3): "The hexadecimal values 'a' through 'f' … are case insensitive on input." The GoTrue server (Go
uuidparser) accepts uppercase UUIDs, so rejecting them in the client is incorrect and blocks valid calls.🔄 Breaking changes
📋 Checklist
pnpm nx format📝 Additional notes
Fail-before / pass-after — added uppercase and mixed-case cases to the
validateUUIDtest inhelpers.test.ts:should accept uppercase UUIDandshould accept mixed-case UUIDboth throw@supabase/auth-js: Expected parameter to be UUID but is nothelpers.test.tstests pass