Skip to main content

What it flags

A session token, Authorization header, API key or other request credential hashed with MD5 or SHA-1: crypto.createHash('md5' | 'sha1') (including a stream piped into it) or crypto.subtle.digest('SHA-1', ...), for example createHash('md5').update(req.cookies.session_token). Collisions for both algorithms are practical to compute, so a digest that stands for a credential is not a safe identifier (CWE-328). Checksums, ETags and cache keys stay quiet: hashing other request data, or storing the digest under a name such as cacheKey or etag, is not reported. Pagination cursors and anti-forgery tokens are not credentials. Passwords are reported by weak-password-hash, and HMACs are not reported.

How to review or fix

Use SHA-256 or stronger. When the digest is stored to look a credential up later, use HMAC-SHA-256 with a server-side key.

Configuration

Set the rule to "off" in loadwise.config.json to drop its findings: