You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pkce): use rejection sampling to remove modulo bias
The naive `byte % CHARSET.length` loop over-represents the first 58
characters of the 66-entry PKCE charset by ~33% because 256 is not a
multiple of 66. Switch to rejection sampling so every character is
equally likely.
Flagged by CodeQL (js/biased-cryptographic-random).
Fix biased character distribution in PKCE code verifier generation. Replaces `byte % CHARSET.length` with rejection sampling so every character in the 66-entry charset is equally likely, restoring full entropy.
0 commit comments