Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/auth-js/src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export function getAlgorithm(
}
}

const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i

export function validateUUID(str: string) {
if (!UUID_REGEX.test(str)) {
Expand Down
10 changes: 10 additions & 0 deletions packages/core/auth-js/test/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,16 @@ describe('validateUUID', () => {
input: '123e4567-e89b-12d3-a456-426614174000',
shouldThrow: false,
},
{
name: 'should accept uppercase UUID (UUIDs are case-insensitive per RFC 9562/4122)',
input: '123E4567-E89B-12D3-A456-426614174000',
shouldThrow: false,
},
{
name: 'should accept mixed-case UUID',
input: '123e4567-E89B-12d3-A456-426614174000',
shouldThrow: false,
},
{
name: 'should reject invalid UUID format',
input: 'not-a-uuid',
Expand Down