CWE-500: Public Static Field Not Marked Final
An object contains a public static field that is not marked final.
Last updated
Overview
CWE-500 (Public Static Field Not Marked Final) is a variant-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Background
When a field is declared public but not final, the field can be read and written to by arbitrary Java code.
Common consequences
What can happen when CWE-500 is exploited.
Modify Application Data
Affects: Integrity
The object could potentially be tampered with in unexpected ways. Public static variables can be read without an accessor and changed without a mutator by any classes in the application.
Read Application Data
Affects: Confidentiality
The object could potentially allow the object to be read.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages