<div dir="ltr"><div dir="ltr">On Sat, May 22, 2021 at 2:12 AM Ron Pressler <<a href="mailto:ron.pressler@oracle.com">ron.pressler@oracle.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Let me be very clear: the proposers of this JEP, some of whom have worked on the Security Manager for the<br>
last twenty years, strongly believe that not only will its removal not harm Java’s security, but considerably<br>
improve it, as do the maintainers of other platforms who have decided to either not try to offer security<br>
through the deep stack-dependent sandbox model or did but have since also removed it. Their view is backed<br>
by security experts, both those working on OpenJDK and outside it.<br></blockquote><div><br></div><div>I understand that maintaining the Security Manager is a burden. I understand the argument that not<br></div><div>having the Security Manager would allow resources to be better deployed elsewhere. Yet here we're<br></div><div>only seeing the one side. It would be good to be able to see the ways in which Java's security would<br></div><div>be improved by this JEP, because at the moment we're having to take that on trust.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
While I seriously hope you don’t actually believe a decision was made before publication, it is also obviously<br>
true that this wouldn’t have been proposed in the first place without *a lot* of thought, study and discussion.<br>
The proposal was made only after it was clear this was a very, *very* strong case, and that the chances of finding<br>
fault with it are low. It wasn’t put up after someone just had an idea. It is, therefore, not entirely <br>
surprising that no one has been able to give any relevant arguments against it. Clearly, you have had far less <br>
time to think about it, but I can’t seem to steer your arguments in a direction that’s relevant to what is actually <br>
the issue.<br>
<br>
I understand you’re invested in the Security Manager and that its removal would impose real costs on you. I am even<br>
willing to believe that you actually believe that, despite what studies show, despite what experts say, despite<br>
what the developers of Java say, despite what the developers of *all* other mainstream software platforms with <br>
an emphasis on security, both new and old —- from .NET to WebAssembly —- have concluded after decades of experience, <br>
that the Security Manager is not only the best way to secure Java but apparently the only one. Maybe you’re right <br>
and those others are wrong, but please accept that we all want to improve Java’s security, we just disagree with you <br>
on the best way to do it.<br>
<br>
Yes, additional security measures, whatever they are, would provide additional security. But if the choice is <br>
between measure A and measure B -— you *can’t* have both —- you pick the one that is *more* effective per cost.<br></blockquote><div><br></div><div>And yet the proposal in front of us is to remove measure A, which *will* reduce security for those using it.<br></div><div>Where's the proposal for measure B, so we can evaluate whether the tradeoff between A and B is beneficial?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
None of your arguments so much as glance in that direction, and they don’t acknowledge the fact that Java security <br>
would be hardly affected by the Security Manager’s removal even without better protection elsewhere for the simple <br>
reason that it is hardly ever installed, including on the most security-critical applications, whose defences <br>
apparently aren’t so feeble even today. In any event, if the question is, do we want a perimeter fence and security <br>
cameras *XOR* locks on all room doors, the argument that they provide security through different mechanisms so we <br>
should have both completely misunderstands the question. I am also confused by your point about multi-user<br>
applications. Of course different users have different access, but surely you are aware that very few applications<br>
do that using the Security Manager, which isn’t needed —- and is rarely used -— for that purpose.<br>
<br>
Short of making relevant arguments, I would urge you again to focus on suggestions to reduce the harm this proposal <br>
would cause you.<br>
<br>
— Ron<br>
<br>
<br>
<br>
> On 22 May 2021, at 00:17, Peter Firmstone <<a href="mailto:peter.firmstone@zeus.net.au" target="_blank">peter.firmstone@zeus.net.au</a>> wrote:<br>
> <br>
> I had hoped by end of this discussion, that there would at least be an understanding of what OpenJDK is so hastily choosing to destroy.<br>
> <br>
> Once it is gone, it will be irretrievable, it will never be possible to lock down the JVM so securely again.<br>
> <br>
> <br>
> On 21/05/2021 11:06 pm, Ron Pressler wrote:<br>
>> <br>
>>> On 21 May 2021, at 12:52, Peter Firmstone <<a href="mailto:peter.firmstone@zeus.net.au" target="_blank">peter.firmstone@zeus.net.au</a>> wrote:<br>
>>> <br>
>>> It's quite clear this will be pushed through anyway,<br>
>>> <br>
>> No, not *anyway*, but given the fact that the community consists of millions of users, this<br>
>> proposal has been well-publicised,<br>
> <br>
> <br>
> I discovered the proposal on the 11th of the May on a mailing list I was subscribed to and I almost missed it. Yes, it will be pushed through regardless, clearly the decision was made before publication. Everyone saw applets coming, if the developers were serious about supporting applets, they would have designed a stripped down subset of Java, a JVM specifically suited that task which, didn't include things like XML or serialization.<br>
> <br>
> Just think, Applets were killed because of their atrocious security. How ironic.<br>
> <br>
> <br>
>>> The granularity is not arbitrary, you said by class, which is incorrect.<br>
>>> <br>
>>> Granularity is by a combination of one or more of the following:<br>
>>> <br>
>>> • ProtectionDomain<br>
>>> • CodeSource<br>
>>> • Code signers<br>
>>> • ClassLoader<br>
>>> • Principals.<br>
>> What I said is correct. Assigning a ProtectionDomain to a class is possible, though not to a method<br>
>> (certainly not in code you can’t modify). In fact, ProtectionDomain is defined as “a set of classes,”<br>
>> i.e. class granularity. In particular, that is the granularity that instrumentation with doPrivileged<br>
>> aims to address, and that is one of the Security Manager’s most defining features.<br>
> <br>
> It may be possible to assign a ProtectionDomain, to a single class, but that doesn't make your assertions correct, you should be quoting common use cases, I have never seen an example of assigning permissions to a single class, besides, it requires a dynamic policy to do that, and Java doesn't have one by default, so you can't use PolicyFile to assign it permissions. Maybe you could use it to encapsulate ObjectInputStream with no permissions, then no one could grant it permissions, so that would be useful for Security. It doesn't change class resolution or visibility. But OpenJDK didn't do that, why not?<br>
> <br>
> <br>
> What use case would there be to assign a ProtectionDomain to a method?<br>
> <br>
> Just use a permission check in the method, or wrap a sensitive class with a decorator before publication:<br>
> <br>
> <a href="https://urldefense.com/v3/__http://svn.apache.org/viewvc/river/permission_delegates/src/main/java/org/apache/river/api/delegates/package.html?view=markup__;%21%21GqivPVa7Brio%21LdTftZDa5TWyQFfdIFBzHe3OFQMmnVFcIa0TeUz2kNlVyBaY475E1rWMksv_wkow7A$" rel="noreferrer" target="_blank">https://urldefense.com/v3/__http://svn.apache.org/viewvc/river/permission_delegates/src/main/java/org/apache/river/api/delegates/package.html?view=markup__;!!GqivPVa7Brio!LdTftZDa5TWyQFfdIFBzHe3OFQMmnVFcIa0TeUz2kNlVyBaY475E1rWMksv_wkow7A$</a> <br>
> But these are corner cases.<br>
> <br>
> More useful cases are for isolation, such as JEE.<br>
> <br>
> <br>
>> <br>
>> Restricting access by principal at the application level does not require the Security Manager, so that<br>
>> part is irrelevant, and, in fact, not only Principal, but also Permission, and even CodeSource and<br>
>> ProtectionDomain are *not* being proposed for terminal deprecation or even deprecation by this JEP.<br>
> <br>
> <br>
> I guess your use case is a desktop application running in a single process?<br>
> <br>
> What about a multi user server application running in a single process? Now we have to spawn multiple processes for each user, that's hardly efficient or performant is it?<br>
> <br>
> <br>
>> <br>
>>> I would like to understand this pain that is being caused to a far greater number of people? So far information has been scarce and it seems more of an excuse, as it's very light on detail. I would guess it's the pain of having to update policy files and making sure tests pass with security enabled.<br>
>> The pain is that the high cost of maintaining the Security Manager comes at the expense of<br>
>> other security measures that, we believe, provide far more security value to the Java ecosystem<br>
>> as a whole.<br>
> <br>
> <br>
> Such as?<br>
> <br>
> <br>
>>> I think the results of locking down the JVM to principles of least privilege are totally worth it and a saleable commodity in the current global environment.<br>
>> I absolutely accept the principle of least privilege. I do not accept that the marginal cost/benefit<br>
>> of applying it at class granularity yields its best application.<br>
> <br>
> <br>
> I agree that there's little value for class granularity, but you are applying a corner case that although possible, is never applied in practice, and applying it with a broad brush, then using it as an argument against, please stop making this false assertion. Just because you can do something, doesn't mean that you should. Just because you can walk in front of a passing train, doesn't mean you should sir.<br>
> <br>
> There is however a significant benefit for applying the principle of least privilege.<br>
> <br>
> It can be assigned to Principal and Code signer granularity, that's actually quite coarse grained. It's very flexible, unlike white listing Serializable classes.<br>
> <br>
>>> Sure, theoretical things might, but there's no implementation in existence. It has been quite affordable for me, so I wish to understand this pain, because I currently don't, I'm already using the latest encryption, static analysis, secure coding practices, validating input, sanitizing data etc.<br>
>> There are, though. Here are some: JFR, the module system, crypto protocols and ad-hoc mechanisms for<br>
>> specific vulnerable components (serialization, XML etc.). Maintaining the Security Manager comes at their<br>
>> expense -- some require urgent improvements like adding more events to JFR and closing down gaps in the<br>
>> module system’s defences -- and we believe investing in them has a better security ROI overall.<br>
> <br>
> Don't be rude. These are not alternatives, some are complementary, but not one provides the missing functionality.<br>
> <br>
> And yuck, serialization, XML, vulnerable components should have been given un-privilged ProtectionDomains, so they couldn't do anything privileged while on the stack, like Perl Taint mode. Or better yet alternative implementations created that practice data hygiene.<br>
> <br>
> Java Serialization is a good example of good money thrown after bad, that has a far greater development cost. Why did you (yes you OpenJDK) make Lambda's serializable? Inner classes? Yuck! Put it in a separate library, let people that use it download it, then the platform isn't made insecure for those who don't want it, this is a good use case for your new module system.<br>
> <br>
> Once SecurityManager is gone, attackers will likely be able to bypass your feeble protections, such as whitelisting classes to be de-serialized; they only need to find a way to change a property prior to initialization, the first use of ObjectInputStream, which is quite easy if an application doesn't use it. In future developers who don't use Java serialization will need to make sure it has been initialized so it can't be used as an attack vector, who will remember to do that?<br>
> <br>
>>> Other techniques that are yet to be developed. OpenJDK is deprecating SecurityManager prior to the implementation of it's replacement, a little more notice would have been nice. I'm ready for you to deprecate Serialization, we saw that coming, but this is just completely unexpected out of left field.<br>
>> First, any deprecation proposal could be said to be unexpected until it is proposed. But that is why<br>
>> we have a deprecation policy that makes the process gradual and gives people time to adjust. Second, I<br>
>> don’t think this is "out of left field" at all. The writing on the wall was pretty clear when, after twenty-five<br>
>> years, few projects use the Security Manager and few libraries are properly instrumented for it, other platforms<br>
>> have decided not to adopt a similar model, and those few that have have already abandoned it some years ago.<br>
> <br>
> <br>
> Library's don't need to be instrumented for it, the Java platform is already and provides the necessary protection for network connections, file access and class loading for example.<br>
> <br>
> <br>
> - Peter.<br>
> <br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">-Peter Tribble<br><a href="http://www.petertribble.co.uk/" target="_blank">http://www.petertribble.co.uk/</a> - <a href="http://ptribble.blogspot.com/" target="_blank">http://ptribble.blogspot.com/</a></div></div>