CWE-487 · Słabość
Reliance on Package-level Scope
- Abstrakcja
- Bazowa
- Status
- Niekompletny
- Ryzyko wykorzystania
- średnie
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
Java packages are not inherently closed; therefore, relying on them for code security is not a good practice.
The purpose of package scope is to prevent accidental access by other parts of a program. This is an ease-of-software-development feature but not a security feature.
Skutki
Confidentiality
Read Application Data
Any data in a Java package can be accessed outside of the Java framework if the package is distributed.
Integrity
Modify Application Data
The data in a Java class can be modified by anyone outside of the Java framework if the package is distributed.
Zapobieganie
Architecture and Design, Implementation
Data should be private static and final whenever possible. This will assure that your code is protected by instantiating early, preventing access and tampering.
Słabość nadrzędna
Kiedy powstaje
- Implementation
Dotyczy
Java
Źródła
- The CLASP Application Security Process — Secure Software, Inc., 2005
Wpis z katalogu CWE 4.20.