Skip to content
vetkitChecksChangelogDocumentation

vetkit.c.crypto.insecure-random

A key, token, salt or nonce is generated with rand() / random() or RAND_pseudo_bytes, which are not cryptographically secure.

Last updated:

Suite: Security

c, cpp

A key, token, salt or nonce is generated with rand() / random() or RAND_pseudo_bytes, which are not cryptographically secure.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Use RAND_bytes (OpenSSL), getrandom(2) / arc4random_buf, or randombytes_buf (libsodium).

References

Source: packages/engine/rules/sast/c.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.