CWE-187: Partial String Comparison

VariantIncomplete

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.

View on MITRE
Back to CWE Lookup

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.

Technical Details

Structure
Simple

Applicable To

Languages
Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-187: Partial String Comparison?+

CWE-187: Partial String Comparison is a Common Weakness Enumeration (CWE) entry maintained by MITRE. 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. For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.

What are the security consequences of Partial String Comparison?+

If exploited, CWE-187 (Partial String Comparison) it can compromise Integrity and Access Control, leading to outcomes such as Alter Execution Logic and Bypass Protection Mechanism.

How do you prevent or mitigate Partial String Comparison?+

Recommended mitigations for CWE-187 include: Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.

Which programming languages are affected by Partial String Comparison?+

CWE-187 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Partial String Comparison?+

MITRE documents real CVEs mapped to CWE-187, including CVE-2014-6394, CVE-2004-1012, CVE-2004-0765, CVE-2002-1374 and CVE-2000-0979. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-187 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More