This informative piece guides you with crucial information.
It is important to note that the introduction of logic in the security pathway restricts access to the engine
solely when both a SecurityManager
and a ClassFilter
are in place. Oracle has confirmed that this behavior is intentional.
Therefore, even following the patch for CVE-2018-3183, if a SecurityManager
is not active, the engine
property remains accessible to all scripts, regardless of a ClassFilter
blocking access to Java classes.
From a security standpoint, relying solely on a ClassFilter
is inadequate; a SecurityManager
is also necessary. The disabling of the code providing the engine
property occurs only when both components are present.
(It appears that any security manager can be used - even one that permits all actions. However, for security purposes, or if permitting access to this.engine
is desired, it may be advisable to utilize a subclass of SecurityManager
that at a minimum rejects attempts to spawn processes or change the current security manager. Implementing a default block approach, with allowances for specific actions, may be preferable. It is recommended to prevent unauthorized file writing, network connections, etc.)
After establishing such a security manager, activate it by executing
System.setSecurityManager(yourSecurityManager);
.