Skip to content
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

Insecure Randomness: Affecting crypto-browserify package, versions <2.1.11 #1853

Closed
danieljoppi opened this issue Jan 3, 2018 · 3 comments
Closed
Labels
guidance Question that needs advice or information.

Comments

@danieljoppi
Copy link

crypto-browserify is implementation of crypto for the browser.

Affected versions of the package are vulnerable to Insecure Randomness due to using the cryptographically insecure Math.random(). This function can produce predictable values and should not be used in security-sensitive context.

You can read more about node's insecure Math.random() in Mike Malone's post

@hakanson
Copy link

hakanson commented Jan 3, 2018

I also saw this when running snyk test on a project.

$ snyk test
✗ High severity vulnerability found on crypto-browserify@1.0.9
- desc: Insecure Randomness
- info: https://snyk.io/vuln/npm:crypto-browserify:20140722
- from: redacted@0.0.1 > alexa-sdk@1.0.24 > aws-sdk@2.85.0 > crypto-browserify@1.0.9
No direct dependency upgrade can address this issue.
Run `snyk wizard` to explore remediation options.

@jeskew
Copy link
Contributor

jeskew commented Jan 3, 2018

Hi @danieljoppi and @hakanson,

The result you encountered is a false positive. The AWS SDK for JavaScript uses Node's crypto module (polyfilled with crypto-browserify in the browser SDK) to perform MD5 and SHA-256 hashing when signing requests and does not use it to directly perform any encryption, decryption, or random generation. The only time Math.random could be called is when UUIDs are generated for use as idempotency tokens in browsers that do no support WebCrypto's RandomSource.getRandomValues method.

Closing as a duplicate of #1602

@lock
Copy link

lock bot commented Sep 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

4 participants