You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use Secure Random Number Algorithm for Initialization Vector and Avoid Static IV #190
I have identified a potential security issue in the method get_initialization_vector within the class responsible for encryption configuration. The current implementation allows for the use of a static initialization vector (IV) and uses a non-secure random number generation method. The code snippet is as follows:
Using a static IV is insecure as it can lead to the same ciphertext being generated for the same plaintext, which can be exploited by an attacker. Additionally, the use of random.randint is not cryptographically secure.
It is recommended to always use a cryptographically secure random number generator for creating the IV. The static IV fallback should be removed to ensure that a new, random IV is used for every encryption operation.
For the specific code modification, please use a secure random number generator such as os.urandom or SystemRandom from the random module, and remove the option to return a static IV.
link:
Using a static IV is insecure as it can lead to the same ciphertext being generated for the same plaintext, which can be exploited by an attacker.
Cryptor with static IV intentionally kept to let user keep using it (if they can't easily migrate). User always can use AesCbcCryptoModule crypto module as shown in the docs.
Now we are using native secrets to generate random initialization vector.
Activity
parfeon commentedon Oct 26, 2026
Cryptor with static
IVintentionally kept to let user keep using it (if they can't easily migrate). User always can useAesCbcCryptoModulecrypto module as shown in the docs.Now we are using native secrets to generate random initialization vector.