-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PREDICTABLE RANDOM NUMBER GENERATOR [Security issue] #57
Comments
@lhuria94 what makes u say it uses a predictable random number generator? |
this it the randombytes module used: https://github.com/mvayngrib/react-native-randombytes the method of getting random bytes depends on async/sync usage: https://github.com/mvayngrib/react-native-randombytes#usage the async method: https://github.com/mvayngrib/react-native-randombytes/blob/master/RNRandomBytes.m#L32 the sync method uses SJCL with a random seed generated by SecRandomCopyBytes |
Oh okay, that means instead of using it like: We should use:
|
@lhuria94 yes, that would be the more secure way to use it. I've been meaning to update react-native-randombytes to use the newly available synchronous react-native bridge methods (via RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD), so that the sync method would work as well but haven't gotten to it yet |
No worries, Thanks a lot for the quick help. Ill update if this resolves the security issue. |
Issue:
The mobile application uses a predictable Random Number Generator (RNG).
Under certain conditions this weakness may jeopardize mobile application data encryption or other protection based on randomization. For example,
if encryption tokens are generated inside of the application and an attacker can provide application with a predictable token to validate and then
execute a sensitive activity within the application or its backend.
Reference:
Can you help if this is related to crypto randomBytes function?
The text was updated successfully, but these errors were encountered: