1313
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 697 Incorrect Comparison 1530
ChildOf 573 Improper Following of Specification by Caller 1298
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 1006 Bad Coding Practices 2422
Applicable Platforms
Language : Java (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Integrity
Other
Other
If this invariant is not upheld, it is likely to cause trouble if
objects of this class are stored in a collection. If the objects
of the class in question are used as a key in a Hashtable or
if they are inserted into a Map or Set, it is critical that equal
objects have equal hashcodes.
Detection Methods
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST),
can find some instances of this weakness by analyzing source code (or binary/compiled code)
without having to execute it. Typically, this is done by building a model of data flow and control
flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input)
with "sinks" (destinations where the data interacts with external components, a lower layer such
as the OS, etc.)
Effectiveness = High
Potential Mitigations
Phase: Implementation
Both Equals() and Hashcode() should be defined.
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 850 The CERT Oracle Secure Coding Standard for Java
(2011) Chapter 7 - Methods (MET)
844 2364
MemberOf 977 SFP Secondary Cluster: Design 888 2407
MemberOf 1140 SEI CERT Oracle Secure Coding Standard for Java -
Guidelines 06. Methods (MET)
1133 2447
MemberOf 1412 Comprehensive Categorization: Poor Coding Practices 1400 2538
Taxonomy Mappings
CWE Version 4.14
CWE-582: Array Declared Public, Final, and Static
CWE-582: Array Declared Public, Final, and Static