Find use of insecure random number generation in Go
ProprietaryFinds Go calls into math/rand and math/rand/v2. These generators are not cryptographically secure and must not be used to produce secrets, tokens, nonces, salts, or any other security-sensitive value. Use crypto/rand instead.
org. openrewrite. golang. security. search. FindInsecureRandommod run . --recipe= org. openrewrite. golang. security. search. FindInsecureRandomInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Find method usages
math/rand Int(..) - Find method usages
math/rand Intn(..) - Find method usages
math/rand Int31(..) - Find method usages
math/rand Int31n(..) - Find method usages
math/rand Int63(..) - Find method usages
math/rand Int63n(..) - Find method usages
math/rand Uint32(..) - Find method usages
math/rand Uint64(..) - Find method usages
math/rand Float32(..) - Find method usages
math/rand Float64(..) - Find method usages
math/rand Read(..) - Find method usages
math/rand Perm(..) - Find method usages
math/rand Shuffle(..) - Find method usages
math/rand/v2 Int(..) - Find method usages
math/rand/v2 IntN(..) - Find method usages
math/rand/v2 Int32(..) - Find method usages
math/rand/v2 Int32N(..) - Find method usages
math/rand/v2 Int64(..) - Find method usages
math/rand/v2 Int64N(..) - Find method usages
math/rand/v2 Uint32(..) - Find method usages
math/rand/v2 Uint64(..) - Find method usages
math/rand/v2 Float32(..) - Find method usages
math/rand/v2 Float64(..)