CWE-187: Partial String Comparison
18 CVEs have CWE-187 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 16.496%.
The product performs a string comparison that only examines a portion of the string before determining whether there is a match.
Child of CWE-1023: Incomplete Comparison with Missing Factors
Mitigations
- Testing: Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.
Observed examples
- CVE-2014-6394: Product does not prevent access to restricted directories due to partial string comparison with a public directory
- CVE-2004-1012: Argument parser of an IMAP server treats a partial command body[p as if it is body.peek, leading to index error and out-of-bounds corruption.
- CVE-2004-0765: Web browser only checks the hostname portion of a certificate when the hostname portion of the URI is not a fully qualified domain name (FQDN), which allows remote attackers to spoof trusted certificates.
- CVE-2002-1374: One-character password by attacker checks only against first character of real password.
- CVE-2000-0979: The password is not properly checked, which allows remote attackers to bypass access controls by sending a 1-character password that matches the first character of the real password.
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-187'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-187'
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).