Skip to content

Commit 961b710

Browse files
committed
fix: use base64url encoding for OAuth state nonce in remaining locations
Follow-up to PR #574 - the same base64 vs base64url encoding mismatch existed in two other locations that generate OAuth state nonces. The security fix (50e230c) added validation expecting base64url-encoded nonces, but these UI routes were still using standard base64 encoding.
1 parent 1f2cecf commit 961b710

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/routes-ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4341,7 +4341,7 @@ ${Buffer.from(data.content, 'base64url').toString('base64')}
43414341
name: request.payload.name,
43424342

43434343
// identify request
4344-
n: crypto.randomBytes(NONCE_BYTES).toString('base64'),
4344+
n: crypto.randomBytes(NONCE_BYTES).toString('base64url'),
43454345
t: Date.now()
43464346
});
43474347

lib/ui-routes/account-routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ function init(args) {
426426
name: request.payload.name,
427427

428428
// identify request
429-
n: crypto.randomBytes(NONCE_BYTES).toString('base64'),
429+
n: crypto.randomBytes(NONCE_BYTES).toString('base64url'),
430430
t: Date.now()
431431
});
432432

0 commit comments

Comments
 (0)