Difference between revisions of "Not using a random initialization vector with cipher block chaining mode"

From OWASP
Jump to: navigation, search
(Related Controls)
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
{{Template:Vulnerability}}
 
{{Template:SecureSoftware}}
 
{{Template:SecureSoftware}}
 
{{Template:Vulnerability}}
 
 
[[Category:FIXME|This is the text from the old template. This needs to be rewritten using the new template.]]
 
  
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
  
 
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]
 
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]
 
[[ASDR Table of Contents]]
 
__TOC__
 
 
  
 
==Description==
 
==Description==
Line 25: Line 18:
 
'''Exposure period'''
 
'''Exposure period'''
  
* Implementation: Many logic errors can lead to this condition if multiple data streams have a common beginning sequences.
+
* Implementation: Many logic errors can lead to this condition if multiple data streams have common beginning sequences.
  
 
'''Platform'''
 
'''Platform'''
Line 44: Line 37:
 
Medium
 
Medium
  
CBC is the most commonly used mode of operation for a block cipher. It solves electronic code book's dictionary problems by XORing the ciphertext with plaintext. If it used to encrypt multiple data streams, dictionary attacks are possible, provided that the streams have a common beginning sequence.
+
CBC is the most commonly used mode of operation for a block cipher. It solves electronic code book's dictionary problems by XORing the ciphertext with plaintext. If it is used to encrypt multiple data streams, dictionary attacks are possible, provided that the streams have a common beginning sequence.
 
+
  
 
==Risk Factors==
 
==Risk Factors==
Line 104: Line 96:
 
==Related [[Controls]]==
 
==Related [[Controls]]==
  
* Integrity: It is important to properly initialize CBC operating block ciphers or there use is lost.
+
* Integrity: It is important to properly initialize CBC operating block ciphers or their use is lost.
 
+
  
 
==Related [[Technical Impacts]]==
 
==Related [[Technical Impacts]]==

Latest revision as of 07:53, 27 February 2009

This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.



Last revision (mm/dd/yy): 02/27/2009

Vulnerabilities Table of Contents

Description

Not using a random initialization vector with Cipher Block Chaining (CBC) Mode causes algorithms to be susceptible to dictionary attacks.

Consequences

  • Confidentiality: If the CBC is not properly initialized, data which is encrypted can be compromised and therefore be read.
  • Integrity: If the CBC is not properly initialized, encrypted data could be tampered with in transfer or if it accessible.
  • Accountability: Cryptographic based authentication systems could be defeated.

Exposure period

  • Implementation: Many logic errors can lead to this condition if multiple data streams have common beginning sequences.

Platform

  • Languages: Any
  • Operating platforms: Any

Required resources

Any

Severity

High

Likelihood of exploit

Medium

CBC is the most commonly used mode of operation for a block cipher. It solves electronic code book's dictionary problems by XORing the ciphertext with plaintext. If it is used to encrypt multiple data streams, dictionary attacks are possible, provided that the streams have a common beginning sequence.

Risk Factors

  • Talk about the factors that make this vulnerability likely or unlikely to actually happen
  • Discuss the technical impact of a successful exploit of this vulnerability
  • Consider the likely [business impacts] of a successful attack


Examples

In C/C++:

#include <openssl/evp.h>

EVP_CIPHER_CTX ctx;
char key[EVP_MAX_KEY_LENGTH];
char iv[EVP_MAX_IV_LENGTH];

RAND_bytes(key, b);
memset(iv,0,EVP_MAX_IV_LENGTH);
EVP_EncryptInit(&ctx,EVP_bf_cbc(), key,iv);

In Java:

public class SymmetricCipherTest {
   public static void main()  {
      byte[] text ="Secret".getBytes();
      byte[] iv ={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

      KeyGenerator kg = KeyGenerator.getInstance("DES");
      kg.init(56);
      SecretKey key = kg.generateKey();
     
      Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
      IvParameterSpec ips = new IvParameterSpec(iv);
      cipher.init(Cipher.ENCRYPT_MODE, key, ips);
      return cipher.doFinal(inpBytes);
   }
 }


Related Attacks


Related Vulnerabilities

Related Controls

  • Integrity: It is important to properly initialize CBC operating block ciphers or their use is lost.

Related Technical Impacts


References

Note: A reference to related CWE or CAPEC article should be added when exists. Eg: