2060
[REF-1080]Christopher Tarnovsky. "Security Failures in Secure Devices". < https://
www.blackhat.com/presentations/bh-europe-08/Tarnovsky/Presentation/bh-eu-08-tarnovsky.pdf >.
CWE-1254: Incorrect Comparison Logic Granularity
Weakness ID : 1254
Structure : Simple
Abstraction : Base
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.
Extended Description
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.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 697 Incorrect Comparison 1530
ChildOf 208 Observable Timing Discrepancy 529
PeerOf 1261 Improper Handling of Single Event Upsets 2079
Applicable Platforms
Language : Not Language-Specific (Prevalence = Undetermined)
Operating_System : Not OS-Specific (Prevalence = Undetermined)
Architecture : Not Architecture-Specific (Prevalence = Undetermined)
Technology : Not Technology-Specific (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Confidentiality
Authorization
Bypass Protection Mechanism
Potential Mitigations
Phase: Implementation
The hardware designer should ensure that comparison logic is implemented so as to compare in
one operation instead in smaller chunks.
Demonstrative Examples
Example 1:
CWE Version 4.14
CWE-1254: Incorrect Comparison Logic Granularity
CWE-1254: Incorrect Comparison Logic Granularity