The product performs a comparison between entities that must consider multiple factors or characteristics of each entity, but the comparison does not include one or more of these factors.
View on MITREAn incomplete comparison can lead to resultant weaknesses, e.g., by operating on the wrong object or making a security decision without considering a required factor.
Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.
No detection method information available for this CWE.
Consider an application in which Truck objects are defined to be the same if they have the same make, the same model, and were manufactured in the same year.
Here, the equals() method only checks the make and model of the Truck objects, but the year of manufacture is not included.
This example defines a fixed username and password. The AuthenticateUser() function is intended to accept a username and a password from an untrusted user, and check to ensure that it matches the username and password. If the username and password match, AuthenticateUser() is intended to indicate that authentication succeeded.
In AuthenticateUser(), the strncmp() call uses the string length of an attacker-provided inPass parameter in order to determine how many characters to check in the password. So, if the attacker only provides a password of length 1, the check will only examine the first byte of the application's password before determining success.
PHP remote file inclusion in web application that filters "http" and "https" URLs, but not "ftp".
View DetailsProduct does not prevent access to restricted directories due to partial string comparison with a public directory
View DetailsNo relationship information available for this CWE.
CWE-1023: Incomplete Comparison with Missing Factors is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product performs a comparison between entities that must consider multiple factors or characteristics of each entity, but the comparison does not include one or more of these factors. An incomplete comparison can lead to resultant weaknesses, e.g., by operating on the wrong object or making a security decision without considering a required factor.
If exploited, CWE-1023 (Incomplete Comparison with Missing Factors) it can compromise Integrity and Access Control, leading to outcomes such as Alter Execution Logic and Bypass Protection Mechanism.
Recommended mitigations for CWE-1023 include: Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.
CWE-1023 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
MITRE documents real CVEs mapped to CWE-1023, including CVE-2005-2782 and CVE-2014-6394. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.
A CWE (Common Weakness Enumeration) like CWE-1023 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.