CWEweakness

CWE-187 Partial String Comparison

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Incomplete
Languages
Not Language-Specific
CWE version
5.0

Description

The product performs a string comparison that only examines a portion of the string before determining whether there is a match.

Common consequences

• Integrity, Access Control: Alter Execution Logic, Bypass Protection Mechanism — An attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.

Potential 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.

Related

Observed example · CVE (5)

  • CVE-2014-6394 visionmedia send before 0.8.4 for Node.js uses a partial comparison for verifying whether a directory is within the document root, which… vulnerability
  • CVE-2004-1012 The argument parser of the PARTIAL command in Cyrus IMAP Server 2.2.6 and earlier allows remote authenticated users to execute arbitrary… vulnerability
  • CVE-2004-0765 The cert_TestHostName function in Mozilla before 1.7, Firefox before 0.9, and Thunderbird before 0.7, only checks the hostname portion of a… vulnerability
  • CVE-2002-1374 The COM_CHANGE_USER command in MySQL 3.x before 3.23.54, and 4.x before 4.0.6, allows remote attackers to gain privileges via a brute force… vulnerability
  • CVE-2000-0979 File and Print Sharing service in Windows 95, Windows 98, and Windows Me does not properly check the password for a file share, which… vulnerability

Child of · CWE (1)

  • CWE-1023 Incomplete Comparison with Missing Factors weakness

Referenced by CVE · weakness (18)

  • CVE-2026-112266 SGLang through 0.5.22 contains a denial of service vulnerability that allows API clients to abort other users' in-flight generation… vulnerability
  • CVE-2026-94576 An authentication logic and privilege escalation vulnerability exists in the account management interface of Brocade Fabric OS versions… vulnerability
  • CVE-2026-101914 @grpc/grpc-js implements the core functionality of gRPC purely in JavaScript, without a C++ addon. vulnerability
  • CVE-2026-81479 Dell OpenManage Server Administrator, versions prior to 11.1.0.3, contains a Partial String Comparison vulnerability. vulnerability
  • CVE-2026-87853 A flaw was found in SSSD's IdP authentication provider. vulnerability
  • CVE-2026-84376 Astro is a web framework for content-driven websites. vulnerability
  • CVE-2026-62750 Partial string comparison in Windows HTTP Protocol Stack allows an unauthorized attacker to perform tampering over an adjacent network. vulnerability
  • CVE-2026-14687 A vulnerability was determined in 666ghj BettaFish up to 1.2.1. vulnerability
  • CVE-2026-45692 Caddy is an extensible server platform that uses TLS by default. vulnerability
  • CVE-2026-55602 http-proxy-middleware is node.js http-proxy middleware. vulnerability
  • CVE-2026-44837 view_component is a framework for building reusable, testable, and encapsulated view components in Ruby on Rails. vulnerability
  • CVE-2026-35031 Jellyfin is an open source self hosted media server. vulnerability
  • CVE-2026-34785 Rack is a modular Ruby web server interface. vulnerability
  • CVE-2026-30874 OpenWrt Project is a Linux operating system targeting embedded devices. vulnerability
  • CVE-2025-23384 A vulnerability has been identified in RUGGEDCOM RM1224 LTE(4G) EU (6GK6108-4AM00-2BA2) (All versions < V8.2.1), RUGGEDCOM RM1224 LTE(4G)… vulnerability
  • CVE-2024-41110 Moby is an open-source project created by Docker for software containerization. vulnerability
  • CVE-2024-39742 IBM MQ Operator 3.2.2 and IBM MQ Operator 2.0.24 could allow a user to bypass authentication under certain configurations due to a partial… vulnerability
  • CVE-2022-31802 In CODESYS Gateway Server V2 for versions prior to V2.3.9.38 only a part of the the specified password is been compared to the real CODESYS… vulnerability

Referenced by CWE · can precede (1)

  • CWE-185 Incorrect Regular Expression weakness

Referenced by CWE · peer of (1)

  • CWE-625 Permissive Regular Expression weakness