This vulnerability occurs when a class exposes a public static field without declaring it as final, allowing unintended modification from anywhere in the application.
Public static fields act as global variables within your application's classloader. Because they are public, any other class can directly read and, crucially, modify their value without using proper getter or setter methods. This bypasses any validation, logging, or synchronization logic you might have in place, leading to unpredictable state changes that are difficult to trace and debug. To prevent this, you should mark any necessary public static fields as `final` to make them constants. If a field truly needs to be mutable, consider making it private and providing controlled access through static methods, applying the principle of encapsulation even to static members to maintain data integrity and thread safety.
Impact: Modify Application Data
The object could potentially be tampered with.
Impact: Read Application Data
The object could potentially allow the object to be read.
c++javac++javaHigh