Skip to content

Use of a broken or risky cryptographic algorithm

Description

The RC4 stream-cipher has been cryptographically broken and is unsuitable for use in production. It is recommended that ChaCha20 or Advanced Encryption Standard (AES) be used instead. Consider using `XChaCha20Poly1305` or `AES-256-GCM`.

Examples

Insecure Code

go
import "crypto/rc4"

Secure Code

go
import "golang.org/x/crypto/chacha20poly1305"

Remediation

Replace the RC4 stream-cipher with a secure alternative like `XChaCha20Poly1305` or `AES-256-GCM`.

Rule Details

FieldValue
IDCODE-0773
CategoryCrypto
SeverityMEDIUM
CWECWE-327
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityEASY
Tagscryptography, security
OWASPA3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures