Umbra Wiki weakness weakness/CWE-1254
Back to wiki

CWE-1254 — Incorrect Comparison Logic Granularity

provenance: imported · CWE: CWE-1254

CWE-1254: Incorrect Comparison Logic Granularity

MITRE CWE weakness

Kind Weakness
Abstraction Base
Status Draft
Likelihood of exploit

Description

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.

Common consequences

  • Confidentiality, Authorization: Bypass Protection Mechanism

Mitigations

Implementation — The hardware designer should ensure that comparison logic is implemented so as to compare in one operation instead in smaller chunks.

References

  • CWE page: https://cwe.mitre.org/data/definitions/1254.html
  • CWE list: https://cwe.mitre.org/data/index.html