It's Time for "Hardned Java"

With the new Java vulnerability making the rounds I think it's time for an OpenJDK vendor to pick up the glove and release a "Hardened OpenJDK". A version that will be resistant to exploits even if a vulnerability exists!

Here's how this will look...

I want to preface this by saying: I'm not a security expert. But the general problem with Java is the HUGE surface area.

Removing some "problematic" features and disabling their default behaviors can address most issues before they even begin.

To be clear this will break compatibility for some apps so every feature will need to be togglable by configuration. It can't be called Java but it can be based on an OpenJDK fork and adapting your code should be trivial. It can still be pretty compatible by passing a TCK with whitelisted features required by the TCK. Still the whitelisting process is effectively an incompatible requirement.

Every time a check blocks something it should throw an exception so we can fix/whitelist this if necessary by our apps.

This is similar to the SecurityManager that can be leveraged for this purpose. However, that class was designed for client-side code.

Read Only Filesystem

This will block many exploits like the recent Spring4Shell. You need to write to a file you MUST whitelist it. You can't rename files or change executable properties etc. without explicitly whitelisting this.

No Execution

This would outright block most common exploits. Runtime.exec, Process etc. will require whitelisting specific commands.

No native libraries that aren't whitelisted obviously.

No "Problematic APIs"

JNDI and similar APIs that have been used in exploits in the past.

Serialization

Serialization would have a filter on by default that would block all classes except for explicitly whitelisted classes.

Sanitized Logging

All logged data will be sanitized by default. Since most logs go through JUL this can be done relatively easily although will include some performance overhead.

Certificate Pinning

All outgoing network connections should use pinned certificates or be explicitly whitelisted. This is a tough one...

But we need a way to mitigate potential forgeries.

I'm guessing this is a feature many will turn off.

Final Word

I understand why Oracle can't do that. Java's "thing" is compatibility and that's great!

This seems like a place where an OpenJDK vendor can make a difference.

Thoughts? Improvements? Corrections?

To view or add a comment, sign in

More articles by Shai Almog

  • I ❤️ IDEs

    I've been a programmer since well before we had IDEs and I ❤️ them! Hacker News has an IDE vs. Emacs/vim thread that's…

    1 Comment
  • How Effective are your Debugging Skills?

    We all know how to debug..

  • I used to be a Terrible Speaker yet I was Highly Rated

    I used to be a terrible conference speaker. Yet I was highly rated.

    1 Comment
  • Why (and How) we Left App Engine After it Almost Destroyed Us

    Last week I saw this post which reminded me a lot of our experience with App Engine a few years ago. I shared that in a…

    1 Comment
  • Why Full Stack Matters

    Thanks for the great feedback on my previous post, there were many insightful & interesting comments. I’d like to…

  • Full Stack Java

    Over the past few years I’ve spoken and presented at a lot of conferences. 10 years ago when I would go to a Java…

  • How to pick the right Cross Platform Solution

    I'm not exactly objective in this field as I'm the co-founder of a cross platform mobile development tool vendor…

    14 Comments
  • Is A Booth At JavaOne Worth The Expense?

    There is a certain lack of information about what you “get” when signing up for booths at conferences other than the…

    7 Comments
  • JavaZone Trip Report

    JavaZone is winding down as I'm starting to write this although I'll probably post this after the videos are up to…

  • WORA Is Better Than Native

    When “Write Once Run Anywhere” is done right it can produce applications that are “better” than native apps by…

Others also viewed

Explore content categories