Skip to content

Missing Support for Integrity Check

Description

The ciphertext produced is susceptible to alteration by an adversary. This means that the cipher provides no way to detect that the data has been tampered with. If the ciphertext can be controlled by an attacker, it could be altered without detection.

Examples

Insecure Code

scala
javax.crypto.Cipher.getInstance("AES/CBC/PKCS5Padding");

Secure Code

scala
javax.crypto.Cipher.getInstance("AES/GCM/NoPadding");

Remediation

Use a cipher mode that provides integrity checking, such as GCM or CCM.

Rule Details

FieldValue
IDCODE-0021
CategoryCrypto
SeverityMEDIUM
CWECWE-353
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagscryptography, integrity
OWASPN/A