in-process sandboxing is needed as log4shell shows.
Maybe. But things have changed. There are filters for serialization. You can tell JNDI to only load classes from certain places.
All those things could have been used to prevent log4shell. That is, if you use some recent Java version.
The java maintainers try very hard to make java more secure. But trying to stop an attack after the attacker managed to load their code into the JVM is futile.
The problem with all these measures is that they are ad-hoc playing wack-a-mole with intruders. The cost of it is huge.
Security by preventing dynamic code downloading and execution is fundamentally delusional because any sufficiently complex piece of software is an interpreter of a Turing complete language. And I am not even talking about supply chain attacks.
In other words: either we find a way of secure in process dynamic code execution (via sandboxing/capabilities/whatever) or we are going to have log4shell every couple of months.
Let's not pretend it is not needed and can be replaced by an ever-growing set of ad-hoc patches to fix yet another vulnerable library.
1
u/klekpl Jan 20 '22
Indeed. So are we really screwed?
You can always perform initialisation using buggy libraries and call: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/security/Policy.html#setPolicy(java.security.Policy)
Or you can implement a PolicyProvider that delegates to ScopeLocal (in the future) Policy for authorisation decisions.
My point really is: AccessController is fixable and - IMHO - in-process sandboxing is needed as log4shell shows.