Skip to content

feat: otp token hash with salt - #2650

Open
staaldraad wants to merge 1 commit into
masterfrom
feat/prodsec-228
Open

feat: otp token hash with salt#2650
staaldraad wants to merge 1 commit into
masterfrom
feat/prodsec-228

Conversation

@staaldraad

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Bug fix / feature

What is the current behavior?

otp hashes are generated in a predictable manner, making calculation of possible hash values possible.

What is the new behavior?

Uses unique per instance salt when calculating otp hashes (otp, verify tokens, invite tokens). Hash values remain deterministic per instance but not enumerable without knowing the secret salt value. Falls back to unsalted hash lookup. Unsalted values will naturally expire according to otp validity period, the legacy lookup code can be safely removed then.

Uses unique per instance salt when calculating otp hashes (otp, verify
tokens, invite tokens). Falls back to unsalted hash lookup. Unsalted
values will naturally expire according to otp validity period, the
legacy lookup code can be safely removed then.
@staaldraad
staaldraad requested a review from a team as a code owner July 27, 2026 12:59
@blacksmith-sh

blacksmith-sh Bot commented Jul 27, 2026

Copy link
Copy Markdown

Found 24 test failures on Blacksmith runners:

Failures

Test View Logs
github.com/supabase/auth/internal/api/TestAnonymous View Logs
github.com/supabase/auth/internal/api/TestAnonymous View Logs
github.com/supabase/auth/internal/api/TestE2EHooks View Logs
github.com/supabase/auth/internal/api/TestE2EHooks View Logs
github.com/supabase/auth/internal/api/TestE2EHooks/SendEmail/
SecureEmailChange=Disabled/EmailChangeAnonymous
View Logs
github.com/supabase/auth/internal/api/TestE2EHooks/SendEmail/
SecureEmailChange=Disabled/EmailChangeAnonymous
View Logs
github.com/supabase/auth/internal/api/TestExternal View Logs
github.com/supabase/auth/internal/api/TestExternal View Logs
github.com/supabase/auth/internal/api/TestInvite View Logs
github.com/supabase/auth/internal/api/TestInvite View Logs
github.com/supabase/auth/internal/api/TestSignup View Logs
github.com/supabase/auth/internal/api/TestSignup View Logs
github.com/supabase/auth/internal/api/TestSignup/TestVerifySignup View Logs
github.com/supabase/auth/internal/api/TestSignup/TestVerifySignup View Logs
github.com/supabase/auth/internal/api/TestToken View Logs
github.com/supabase/auth/internal/api/TestToken View Logs
github.com/supabase/auth/internal/api/TestVerify View Logs
github.com/supabase/auth/internal/api/TestVerify View Logs
github.com/supabase/auth/internal/api/TestVerify/
TestVeryEmailChangeSendsNotificationEmail/Email_change_notification_disabled
View Logs
github.com/supabase/auth/internal/api/TestVerify/
TestVeryEmailChangeSendsNotificationEmail/Email_change_notification_disabled
View Logs
github.com/supabase/auth/internal/models/TestOneTimeToken View Logs
github.com/supabase/auth/internal/models/TestOneTimeToken View Logs
github.com/supabase/auth/internal/models/TestUser View Logs
github.com/supabase/auth/internal/models/TestUser View Logs

Fix in Cursor

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