CWE-1254: Incorrect Comparison Logic Granularity
3 CVEs have CWE-1254 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 0.410%.
The product's comparison logic is performed over a series of steps rather than across the entire string in one operation. If there is a comparison logic failure on one of these steps, the operation may be vulnerable to a timing attack that can result in the interception of the process for nefarious purposes.
Comparison logic is used to compare a variety of objects including passwords, Message Authentication Codes (MACs), and responses to verification challenges. When comparison logic is implemented at a finer granularity (e.g., byte-by-byte comparison) and breaks in the case of a comparison failure, an attacker can exploit this implementation to identify when exactly the failure occurred. With multiple attempts, the attacker may be able to guesses the correct password/response to challenge and elevate their privileges.
Child of CWE-208: Observable Timing Discrepancy
Mitigations
- Implementation: The hardware designer should ensure that comparison logic is implemented so as to compare in one operation instead in smaller chunks.
Observed examples
- CVE-2019-10482: Smartphone OS uses comparison functions that are not in constant time, allowing side channels
- CVE-2019-10071: Java-oriented framework compares HMAC signatures using String.equals() instead of a constant-time algorithm, causing timing discrepancies
- CVE-2014-0984: Password-checking function in router terminates validation of a password entry when it encounters the first incorrect character, which allows remote attackers to obtain passwords via a brute-force attack that relies on timing differences in responses to incorrect password guesses, aka a timing side-channel attack.
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-1254'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-1254'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).