Weak hash (ARCH3111)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key typescript.security.weak-hash · Severity error · Category security · CWE CWE-328
Using cryptographically broken hash algorithms like MD5 or SHA-1 for security purposes leaves you vulnerable to collision attacks.
Incorrect
Section titled “Incorrect”import { createHash } from "crypto";
const digest = createHash("md5").update(data).digest("hex");Correct
Section titled “Correct”import { createHash } from "crypto";
const digest = createHash("sha256").update(data).digest("hex");Use SHA-256 or a stronger algorithm instead of MD5/SHA-1.