CWE-493 · Słabość
Critical Public Variable Without Final Modifier
- Abstrakcja
- Wariant
- Status
- Szkic
- Ryzyko wykorzystania
- wysokie
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
The product has a critical public variable that is not final, which allows the variable to be modified to contain unexpected values.
If a field is non-final and public, it can be changed once the value is set by any function that has access to the class which contains the field. This could lead to a vulnerability if other parts of the program make assumptions about the contents of that field.
Skutki
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.
Zapobieganie
Implementation
Declare all public fields as final when possible, especially if it is used to maintain internal state of an Applet or of classes used by an Applet. If a field must be public, then perform all appropriate sanity checks before accessing the field from your code.
Słabość nadrzędna
Słabości podrzędne
Kiedy powstaje
- Implementation
Dotyczy
Object-Oriented, Java, C++
Źródła
- Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors — Katrina Tsipenyuk, Brian Chess, Gary McGraw, NIST, 2005
Wpis z katalogu CWE 4.20.