While reading Java Security I came across the below sentences but could not get any satisfactory explanation on the Internet. Can anyone please explain
- Prevents loading of classes with bytecode
- Prevents loading of in illegal packages
While reading Java Security I came across the below sentences but could not get any satisfactory explanation on the Internet. Can anyone please explain
Source code is compiled to bytecode, which is distributed to users. If the bytecode has been damaged, or was not made by a java compiler, then it may be illegal, meaning that the bytes don't make sense.
We cannot, however, be sure that the class itself is safe. There is still the safety net of the SecurityManager which will prevent the class from accessing protected resources such as network and local hard disk, but that in itself is not enough. The class might contain illegal bytecode, forge pointers to protected memory, overflow or underflow the program stack, or in some other way corrupt the integrity of the JVM. Check Topic The Class File Verifier in [1]: http://medialab.di.unipi.it/doc/JNetSec/jns%5Fch5.htm
The byte code verifier makes the following checks: