CVE-2024-23953: Non Constant Time Crypto Comparison

Using `Arrays.equals()` to compare security-sensitive data (like signatures, hashes, or tokens) introduces a timing side-channel vulnerability because it stops comparing at the first mismatched byte. An attacker can exploit this observable timing discrepancy to forge or guess the expected value byte-by-byte. Use `java.security.MessageDigest.isEqual()` for a

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Java
greprules fetch cve-2024-23953-non-constant-time-crypto-comparison --engine opengrep

Description

Using `Arrays.equals()` to compare security-sensitive data (like signatures, hashes, or tokens) introduces a timing side-channel vulnerability because it stops comparing at the first mismatched byte. An attacker can exploit this observable timing discrepancy to forge or guess the expected value byte-by-byte. Use `java.security.MessageDigest.isEqual()` for a