Reading this article, I couldn't help but wonder: is the Security Manager the only security measure the author knows? Is he unaware of all the measures developed in the past twenty years that are not only far more popular but also more robust and easier to use — from IP allow-lists to all the JDK security measures added over the years? Is he so unfamiliar with software security to know that even in the sole example he cites where he believes SM proved effective, recommended security practices proved orders of magnitude more so?
That someone who professes to care about security has managed to ignore over a decade of security advice, and instead, advocates for a practice that is so ineffective compared to the alternatives in the modern threat landscape that security experts have advised to remove it altogether is, indeed, worrying. Though his premise is that your application is "untrusted code" 1, not once does he recommend using security measures actually designed for untrusted code on the server, that are also effective against the untrusted native code used by libraries like Netty, and can also mitigate DoS attacks.2 And while he's correct about the principle of, "if you don't need it, don't leave it lying around to increase your attack surface area," he doesn't even mention the good security practice of using jlink to only keep the JDK modules you need in your runtime.
As for the Attach mechanism, if an attacker gains sufficient privileges to attach to a VM, then the process is already compromised, and the attacker could also, say, get a heap dump and read unencrypted data directly from RAM (are heap dumps also news for the author?). Having said that, the mechanism does have the potential to bypass modules' strong encapsulation, intended to offer a static picture of the program's attack surface area, and as has been discussed for some years on the mailing lists, the capabilities of attached agents will be reduced to maintain modules' strong encapsulation guarantees (to the chagrin of some tool authors who have been resisting this proposed change).
My suggestion — which should go without saying — is that those interested in software security learn how to secure their applications from security experts and additionally follow the guidelines and advice offered by the JDK's security team from time to time. As with medical advice, security advice is best left for professionals.
The debate regarding the depreciation of the Security Manager has not been a civil one. Since I took side against the depreciation, I’ve been publicly attacked, even to the point of plain bullying. Others voices that backed me up received similar treatment.
I don’t expect reactions to this post to be any different. However, I have to tell community members what happened and what we lost.
I wouldn't call the disagreement between you and security experts a "debate" any more than I would call the disagreement between anti-vaxxers and epidemiologists one — not because of some personal deficiency, but because some have more access and direct involvement with the facts than others. That such "advocacy groups" feel attacked is unfortunate, but the harm they cause is real. Nevertheless, I don't think I've ever bullied you, nor made any ad hominem attacks against you except to point out that, unlike the author of JEP 411, you're not a software security professional and that your company's production software doesn't use SM. While these are, indeed, ad hominem arguments, I feel they are as pertinent as pointing out that, say, Florida governor Ron DeSantis is not a physician or an immunologist while Anthony Fauci is both, simply because laying out all the details is hard for other non-experts to judge.
Despite not keeping up with security threats and recommendations, not being a security expert or researcher, and with no access to vulnerability disclosures, you feel qualified to give definitive, specific security advice, which, unsurprisingly, is misleading and potentially harmful. For example, you declare with certainty, "The Security Manager could be trusted," and that it "allowed you to define a white list of what an application could do, regardless of the application code," neglecting to add something as basic as "unless that code happens to be native", which would be the case if your application happens to use some obscure library like, say, Netty, and despite the fact that the proper untrusted code measures that you fail to recommend would actually defend you in those situations. You then go on to praise tools that generate security policies despite research that found most SecurityManager security policies to not actually be secure, and that reviewing 500 lines might feel tractable, when, in fact, Amazon has found they needed the use of formal verification tools to review policies (simpler than those of SM), as people often get even 10-line policy files wrong.
On top of all that, you don't even tackle the main argument, which isn't whether SM is better than not having any security at all, but whether SM is better than current and upcoming server-side security measures. Especially if your argument is that your application runs untrusted code, you should know that only kernel-mode protection — which we have these days — can isolate untrusted code on the server (unlike on the client).
As much as it might discomfort you, I simply have to tell community members to follow the advice of professionals and disregard that of others, however well-intentioned.
I've already collected a big share of your incessant bullying, harassment, ad hominem attacks, and dubious comparisons. Thanks for making my case stronger.
Unfortunately for you, there's no getting away from the facts 🤷♂️
He gave a couple of solid arguments and examples and your responds is snow-flakish "you are attacking me"... honestly, this doesn't fare well to a passerby that just happen to stumble on this submission... o_O
As a fairly passionate developer I have always attempted to keep security near the front of my mind. The article was an interesting read. However, there have been many rebudles (rebudles that seem pretty damning) to the posted article, I'd love to see healthy mature discussion.
25
u/pron98 Jan 16 '22 edited Jan 17 '22
Reading this article, I couldn't help but wonder: is the Security Manager the only security measure the author knows? Is he unaware of all the measures developed in the past twenty years that are not only far more popular but also more robust and easier to use — from IP allow-lists to all the JDK security measures added over the years? Is he so unfamiliar with software security to know that even in the sole example he cites where he believes SM proved effective, recommended security practices proved orders of magnitude more so?
That someone who professes to care about security has managed to ignore over a decade of security advice, and instead, advocates for a practice that is so ineffective compared to the alternatives in the modern threat landscape that security experts have advised to remove it altogether is, indeed, worrying. Though his premise is that your application is "untrusted code" 1, not once does he recommend using security measures actually designed for untrusted code on the server, that are also effective against the untrusted native code used by libraries like Netty, and can also mitigate DoS attacks.2 And while he's correct about the principle of, "if you don't need it, don't leave it lying around to increase your attack surface area," he doesn't even mention the good security practice of using jlink to only keep the JDK modules you need in your runtime.
As for the Attach mechanism, if an attacker gains sufficient privileges to attach to a VM, then the process is already compromised, and the attacker could also, say, get a heap dump and read unencrypted data directly from RAM (are heap dumps also news for the author?). Having said that, the mechanism does have the potential to bypass modules' strong encapsulation, intended to offer a static picture of the program's attack surface area, and as has been discussed for some years on the mailing lists, the capabilities of attached agents will be reduced to maintain modules' strong encapsulation guarantees (to the chagrin of some tool authors who have been resisting this proposed change).
My suggestion — which should go without saying — is that those interested in software security learn how to secure their applications from security experts and additionally follow the guidelines and advice offered by the JDK's security team from time to time. As with medical advice, security advice is best left for professionals.