jaredhanson / jaredhanson/oauth2orize

Use of uid2

Open
#79 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.5k
Forks
472
PR merge metrics
No merged PRs in 30d

Description

I've seen in your examples you mostly use uid2 for unique id generation which is now (in version 0.0.3) using node's `crypto.pseudoRandomBytes()`. As stated in the documentation, these ids are [not necessarily unpredictable](http://nodejs.org/api/crypto.html#crypto_crypto_pseudorandombytes_size_callback), which means not good for token generation.
I think uid2 should be replaced with something using `crypto.randomBytes()` to prevent mistakes.

Contributor guide

Open the contributing guide

Research direction

Start by locating the examples and token-generation paths that use uid2, then review how uid2 obtains randomness in the referenced version. Confirm that token generation uses unpredictable random bytes rather than pseudo-random bytes, and verify the affected examples or tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
authentication, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.