Skip to content
vetkitChecksChangelogDocumentation

vetkit.rust.crypto.static-nonce

An encryption nonce / IV is a constant. Reusing a nonce under the same key breaks the confidentiality and integrity of AES-GCM and ChaCha20-Poly1305 and makes CBC/CTR output predictable.

Last updated:

Suite: Security

rust

An encryption nonce / IV is a constant. Reusing a nonce under the same key breaks the confidentiality and integrity of AES-GCM and ChaCha20-Poly1305 and makes CBC/CTR output predictable.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Generate a fresh nonce per message (Aes256Gcm::generate_nonce(&mut OsRng) or rand::random) and store it next to the ciphertext.

References

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