Skip to content
vetkitChecksChangelogDocumentation

vetkit.js.crypto.static-iv

createCipheriv is called with a constant IV (literal, zero-filled or fixed buffer). Reusing an IV makes ciphertexts linkable and, with CTR/GCM modes, lets attackers recover plaintext and forge messages.

Last updated:

Suite: Security

javascript, typescript

createCipheriv is called with a constant IV (literal, zero-filled or fixed buffer). Reusing an IV makes ciphertexts linkable and, with CTR/GCM modes, lets attackers recover plaintext and forge messages.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Generate a fresh IV for every encryption with crypto.randomBytes(16) (12 bytes for GCM) and store it next to the ciphertext.

References

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