Find non-constant-time comparison of cryptographic digests

Proprietary

Detects when the output of MessageDigest.digest(..) or Mac.doFinal(..) flows into Arrays.equals(byte[], byte[]), a non-constant-time comparison that is vulnerable to timing attacks (CWE-208). Use MessageDigest.isEqual(byte[], byte[]) for security-sensitive byte-array comparisons.

org.openrewrite.analysis.java.security.FindInsecureCryptoComparison
mod run . --recipe=org.openrewrite.analysis.java.security.FindInsecureCryptoComparison

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.