Skip to content
vetkitChecksChangelogDocumentation

vetkit.kotlin.crypto.insecure-random-token

A security-sensitive value (token, password, session id, nonce, salt) is generated with a predictable random number generator.

Last updated:

Suite: Security

kotlin

A security-sensitive value (token, password, session id, nonce, salt) is generated with a predictable random number generator.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Use java.security.SecureRandom (e.g. SecureRandom().asKotlinRandom() for random()/shuffled()) for secrets and tokens; kotlin.random.Random and java.util.Random are predictable.

References

Source: packages/engine/rules/sast/kotlin.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.