CWE-1025: Comparison Using Wrong Factors
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
The code performs a comparison between two entities, but the comparison examines the wrong factors or characteristics of the entities, which can lead to incorrect results and resultant weaknesses.
扩展描述
This can lead to incorrect results and resultant weaknesses. For example, the code might inadvertently compare references to objects, instead of the relevant contents of those objects, causing two "equal" objects to be considered unequal.
常见后果
影响范围: Other
技术影响: Varies by Context
潜在缓解措施
阶段: Testing
描述: Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.
引入模式
| 阶段 | 说明 |
|---|---|
| Implementation | - |