---
title: "CWE-1023: Incomplete Comparison with Missing Factors"
url: https://radicalnotion.ai/cwe/cwe-1023
type: cwe
description: "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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1023: Incomplete Comparison with Missing Factors

- **Abstraction:** Class
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 17
- **Of those, in CISA KEV:** 1
- **New in 2026:** 13
- **CWE catalog version:** 4.21

## Description

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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity, Access Control | Alter Execution Logic, Bypass Protection Mechanism | 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. |

## Detection methods

### Manual Static Analysis

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

## Demonstrative examples

### Example 1

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.

Bad code:

```java
public class Truck {
    private String make;
    private String model;
    private int year;

    public boolean equals(Object o) {
        if (o == null) return false;
        if (o == this) return true;
        if (!(o instanceof Truck)) return false;

        Truck t = (Truck) o;

        return (this.make.equals(t.getMake()) && this.model.equals(t.getModel()));
    }
}
```

Here, the equals() method only checks the make and model of the Truck objects, but the year of manufacture is not included.

### Example 2

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.

Bad code:

```c
/* Ignore CWE-259 (hard-coded password) and CWE-309 (use of password system for authentication) for this example. */

char *username = "admin";
char *pass = "password";

int AuthenticateUser(char *inUser, char *inPass) {
    if (strncmp(username, inUser, strlen(inUser))) {
        logEvent("Auth failure of username using strlen of inUser");
        return(AUTH_FAIL);
    }
    if (! strncmp(pass, inPass, strlen(inPass))) {
        logEvent("Auth success of password using strlen of inUser");
        return(AUTH_SUCCESS);
    }
    else {
        logEvent("Auth fail of password using sizeof");
        return(AUTH_FAIL);
    }
}

int main (int argc, char **argv) {
    int authResult;

    if (argc < 3) {
        ExitError("Usage: Provide a username and password");
    }
    authResult = AuthenticateUser(argv[1], argv[2]);
    if (authResult == AUTH_SUCCESS) {
        DoAuthenticatedTask(argv[1]);
    }
    else {
        ExitError("Authentication failed");
    }
}
```

Attack code:

```
p
pa
pas
pass
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2005-2782 | PHP remote file inclusion in web application that filters "http" and "https" URLs, but not "ftp". |
| CVE-2014-6394 | Product does not prevent access to restricted directories due to partial string comparison with a public directory |

## Real CVEs with this weakness (sample of 12 of 17)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-7473 | Arista EOS Unexpected Tunnel Protocol Decapsulation and Forwarding Bypass | medium | 6.9 | - | Yes | 2026-06-05 |
| CVE-2026-81376 | Visual Studio Code Security Feature Bypass Vulnerability | critical | 9.6 | - | No | 2026-09-08 |
| CVE-2026-4599 | jsrsasign: Incomplete Comparison Allows DSA Private Key Recovery via Biased Nonce Generation | critical | 9.3 | - | No | 2026-03-23 |
| CVE-2026-85491 | Catalyst::Seal versions before 0.03 for Perl allow one request to disable a path or route a later one past an authorization check via a dispatch memo keyed on the request path alone | high | 8.8 | - | No | 2026-09-24 |
| CVE-2026-24255 | - | high | 7.5 | - | No | 2026-08-04 |
| CVE-2021-23146 | - | high | 7.5 | - | No | 2021-11-18 |
| CVE-2025-62000 | BullWall Ransomware Containment incomplete file inspection | medium | 6.9 | - | No | 2025-12-18 |
| CVE-2026-91768 | IPv6 ACL bypass in FastCGI listen.allowed\_clients due to partial address comparison (memcmp 12 bytes) | medium | 6.5 | - | No | 2026-09-25 |
| CVE-2026-123593 | Hickory DNS 0.26.0-beta.1 before 0.26.2 DNSSEC Validation Bypass via TrustAnchors | medium | 6.3 | - | No | 2026-11-08 |
| CVE-2025-55333 | Windows BitLocker Security Feature Bypass Vulnerability | medium | 6.1 | - | No | 2025-10-14 |
| CVE-2026-53859 | OpenClaw \< 2026.5.26 - Hostname Validation Bypass via Trailing-Dot Inconsistency | medium | 6.0 | - | No | 2026-06-16 |
| CVE-2026-53839 | OpenClaw \< 2026.5.7 - Hostname Prefix Matching Bypass in Trusted Retry Endpoint Validation | medium | 6.0 | - | No | 2026-06-12 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-697](https://radicalnotion.ai/cwe/cwe-697) | Incorrect Comparison |
| Child | [CWE-184](https://radicalnotion.ai/cwe/cwe-184) | Incomplete List of Disallowed Inputs |
| Child | [CWE-187](https://radicalnotion.ai/cwe/cwe-187) | Partial String Comparison |
| Child | [CWE-478](https://radicalnotion.ai/cwe/cwe-478) | Missing Default Case in Multiple Condition Expression |
| Child | [CWE-839](https://radicalnotion.ai/cwe/cwe-839) | Numeric Range Comparison Without Minimum Check |

## Frequently asked questions

### What is CWE-1023?

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.

### What CVEs are caused by CWE-1023?

17 recorded CVEs are attributed to CWE-1023, including CVE-2026-7473, CVE-2026-81376 and CVE-2026-4599. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How is CWE-1023 detected?

Manual Static Analysis: Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.

### What are the consequences of CWE-1023?

Exploiting CWE-1023 can lead to: Alter Execution Logic, Bypass Protection Mechanism.

### Is CWE-1023 actively exploited?

Yes. 1 CWE-1023 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 17 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/1023.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-1023). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
