...
This code behaves the same as before, but an attacker can no longer run malicious callback code with elevated privileges. Even though an attacker can pass a malicious callback instance using the constructor of class CallBackAction
, the code is not executed with elevated privileges because the malicious instance must contain a doPrivileged
block that cannot have the same privileges as trusted code. Additionally, class CallBackAction
cannot be subclassed to override the the perform()
method as it is declared final.
...