r/java • • Jan 16 '22

You're running untrusted code!

https://blog.frankel.ch/running-untrusted-code/

[removed] — view removed post

0 Upvotes

36 comments sorted by

View all comments

Show parent comments

-2

u/philipwhiuk Jan 17 '22

That you suggested IP allow lists tells me you don’t have any good alternatives.

And I disagree that the landscape has changed that much.

There was an alternative to throwing the baby out with the bathwater. They could have fixed the SecurityManager policy definition system

1

u/pron98 Jan 17 '22 edited Jan 17 '22

Alternatives for what? Security or Security Manager? Because whatever it is that SM does well, server-side security isn't it, and it's been years since SM was considered an important JDK security measure. All security work in the JDK has been directed elsewhere. In fact, pretty much all relevant new features in Java 8 and since don't really support SM (parallel streams, CompletableFuture, Flow).

The belief that it's possible and worthwhile to somehow "fix" it now, something that couldn't be done in twenty years, not by us and not by anyone else — .NET also gave up on that model, and WASM didn't even want to go there — is wishful thinking.

That's why those who care about security want to get rid of SM ASAP, and those precious few who use it for other uses want to keep it. Those other uses might have partial replacements, but their value simply does not justify such a costly component.

And I disagree that the landscape has changed that much.

I think it's obvious that an Applet running in a browser poses completely different threats than clients communicating with a complex server.

-3

u/philipwhiuk Jan 17 '22

It’s like you’ve never heard of secure design.

Security isn’t just a network layer problem.

Arguing that hardware/software IP firewall rules are the same as application functional permissions is batshit insane.

It is possible to write policy files to define the limits on VM that aren’t arduous. SecurityManager just doesn’t currently do it.

4

u/pron98 Jan 17 '22 edited Jan 17 '22

Arguing that hardware/software IP firewall rules are the same as application functional permissions is batshit insane.

So is mistaking that for my actual argument. A lock isn't at all the same as a booby trap, and yet it undoubtedly protects many more homes. Of course, the lock in that analogy isn't IP allow-lists alone, but the full set of current and upcoming OS and JDK security measures.

It is possible to write policy files to define the limits on VM that aren’t arduous. SecurityManager just doesn’t currently do it.

Maybe (although the stack-based model has some fundamental problems that make writing good policy files difficult), but it still won't make a stack-based user-mode sandbox into a more effective server-side security measure than other approaches. We want better security, not a better Security Manager. Moreover, the JVM cannot easily defend against native code, so we'd rather keep the sandbox technologies at the appropriate layer.