Inner classes are translated into classes that are accessible at package scope and may expose code that the programmer intended to keep private to attackers.
Using sealed classes protects object-oriented encapsulation paradigms and therefore protects code from being extended in unforeseen ways.
Inner Classes do not provide security. Warning: Never reduce the security of the object from an outer class, going to an inner class. If an outer class is final or private, ensure that its inner class is private as well.
Our security experts can help you identify and remediate CWE-492 vulnerabilities in your codebase.
Get Security Assessment