COMMON WEAKNESS ENUMERATIONIncomplete

CWE-187

Partial String Comparison

The product performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.

Abstraction

Variant

Structure

Simple

Likelihood of Exploit

Medium

Understand the problem

What is the problem?

The product performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.

Extended description

For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.

Root cause

How and when does the problem arise?

Lifecycle phase

Implementation

Risk

What does successful exploitation lead to?

Alter Execution LogicBypass Protection Mechanism

Affected security scopes: Integrity, Access Control

Defence

How is it prevented and fixed?

Testing

Testing and verification approach

Detail
Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.