1360
[REF-962]Object Management Group (OMG). "Automated Source Code Security Measure
(ASCSM)". 2016 January. < http://www.omg.org/spec/ASCSM/1.0/ >.
CWE-607: Public Static Final Field References Mutable Object
Weakness ID : 607
Structure : Simple
Abstraction : Variant
Description
A public or protected static final field references a mutable object, which allows the object to be
changed by malicious code, or accidentally from another package.
Relationships
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 471 Modification of Assumed-Immutable Data (MAID) 1121
Applicable Platforms
Language : Java (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Integrity Modify Application Data
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
Protect mutable objects by making them private. Restrict access to the getter and setter as well.
Demonstrative Examples
Example 1:
Here, an array (which is inherently mutable) is labeled public static final.
Example Language: Java (Bad)
public static final String[] USER_ROLES;
MemberOf Relationships
CWE Version 4.14
CWE-608: Struts: Non-private Field in ActionForm Class
CWE-608: Struts: Non-private Field in ActionForm Class