Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I'm loading untrusted code at runtime and for this reason I'm also writing a custom SecurityManager. This untrusted code however lazy-loads some JRE classes that I do not want to block. Would it be safe if I granted "read" permission to the whole JRE directory (System.getProperty("java.home");)? Otherwise, what are the reasons why doing this would be insecure?

share|improve this question
    
"For example, granting permission to access the "java.home" system property gives potentially malevolent code sensitive information about the system environment (the location of the runtime environment's directory)." - download.java.net/jdk8/docs/technotes/guides/security/… –  Flavio Sep 5 '13 at 21:46
    
The SecurityManager is not the place you want to do this sort of this. Code loaded by the boot class loader should have full permissions. Apply highly restricted permissions to the loaded classes. The mechanism is through ProtectionDomains added through subclasses of SecureClassLoader. –  Tom Hawtin - tackline Sep 6 '13 at 12:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.