Changing Math.random to crypto.getRandomValues in bundle #2447
Replies: 2 comments
-
Hey, I guess you're talking about this one ? https://docs.metamask.io/snaps/reference/cli/options/#customizewebpackconfig |
Beta Was this translation helpful? Give feedback.
-
@poi-son-ivy if https://docs.metamask.io/snaps/how-to/debug-a-snap/common-issues/#patch-dependencies |
Beta Was this translation helpful? Give feedback.
-
Hi friends,
I'm catching the following warning:
•
Math.random
was detected in the Snap bundle. This is not a secure source of randomness, and should not be used in a secure context. Usecrypto.getRandomValues
instead.Does anyone have a step by step for getting webpack not to Math. and use crypto. instead? The only place it's used is in dist/bundle.js so I'm assuming there's a config process to tell webpack to use the more cryptographically secure option.
Beta Was this translation helpful? Give feedback.
All reactions