1201
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 493 Critical Public Variable Without Final Modifier 1182
Applicable Platforms
Language : C++ (Prevalence = Undetermined)
Language : Java (Prevalence = Undetermined)
Background Details
When a field is declared public but not final, the field can be read and written to by arbitrary Java
code.
Likelihood Of Exploit
High
Common Consequences
Scope Impact Likelihood
Integrity Modify Application Data
The object could potentially be tampered with.
Confidentiality Read Application Data
The object could potentially allow the object to be read.
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: Architecture and Design
Clearly identify the scope for all critical data elements, including whether they should be regarded
as static.
Phase: Implementation
Make any static fields private and constant. A constant field is denoted by the keyword 'const' in
C/C++ and ' final' in Java
Demonstrative Examples
Example 1:
The following examples use of a public static String variable to contain the name of a property/
configuration file for the application.
CWE Version 4.14
CWE-500: Public Static Field Not Marked Final
CWE-500: Public Static Field Not Marked Final