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
| Field | Value |
|---|---|
| ID | CODE-0773 |
| Category | Crypto |
| Severity | MEDIUM |
| CWE | CWE-327 |
| Confidence | HIGH |
| Impact | MEDIUM |
| Likelihood | MEDIUM |
| Exploitability | EASY |
| Tags | cryptography, security |
| OWASP | A3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures |