Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hazelcast is vulnerable to untrusted deserialization remote code execution #8024

Closed
drosenbauer opened this issue Apr 26, 2016 · 10 comments
Closed

Comments

@drosenbauer
Copy link

I emailed the support address on April 17 and received a response indicating that I should report my findings here. So here we are.

The Hazelcast cluster join procedure is vulnerable to remote code execution due to Java deserialization. If an attacker can reach a listening Hazelcast instance with a crafted JoinRequest, and vulnerable classes are also on the classpath, the attacker can run arbitrary shell commands (among other nefarious things). Hazelcast will blindly deserialize any object it receives in that request stream. Since the JoinRequest is what implements authentication, this is necessarily pre-authentication.

This was verified against the latest code from the Git repository, as well as releases 3.7 and 3.2.1.

I have a small whitelist/blacklist filter patch that I can submit a PR for, once I'm cleared to do so. I've already emailed the signed form. Or if you have another solution, feel free!

If you choose to go the filtering route, the Hazelcast team should probably create a default whitelist for serialization, because blacklists are almost always out of date as soon as they are created.

@houey
Copy link

houey commented Mar 17, 2017

any progress on this issue?

@kwart
Copy link
Member

kwart commented Jan 30, 2018

The issue is not resolved yet. Users using Enterprise edition can avoid the untrusted deserialization in member joining procedure by

  • either enabling symmetric encryption;
  • or configuring TLS with mutual authentication

If the member discovery mode is UDP multicast, then only the symmetric encryption avoids the abuse.

@jerrinot
Copy link
Contributor

jerrinot commented May 21, 2018

Once more thanks for reporting the issue. #12230 is addressing it. It allows to define black/while lists for deserialization.

@martinfurmanski
Copy link

Could we get this ported to 3.7 release branch?

@anuragpathak2608
Copy link

@drosenbauer , do you have any data to pentest hazlecast publicly open port?

@peterchenadded
Copy link

Can someone confirm @kwart comment?

@kwart
Copy link
Member

kwart commented Oct 9, 2019

@peterchenadded are you asking for attack ready data? No, I don't provide such data.

@peterchenadded
Copy link

@kwart No I mean does enabling SSL/encryption actually prevent the vulnerability? Can someone confirm?

Also the cve states that's it's vulnerable in hazelcast 3.10.x but wasn't the blacklist/whitelist feature to prevent the issue added in 3.10.0, just that you had to manually enable it.

@kwart
Copy link
Member

kwart commented Oct 10, 2019

@peterchenadded The SSL/TLS with mutual authentication requires client to authenticate with its valid certificate. If the client successfully authenticates, then it's considered a trusted one (i.e. not a one who would attack deserialization routines). No deserialization takes place before TLS is fully established. When using TLS it's necessary to disable the multicast discovery because TLS is TCP-based and multicast works over the UDP.

Similar protection works for symmetric encryption. Nevertheless, there is another issue - symmetric encryption only works between member nodes, so client protocol can't be protected by this approach.

The fix was introduced in 3.11 and part of it is backported to 3.10.1. The backport is configured by Hazelcast properties - see https://docs.hazelcast.org/docs/3.10.5/manual/html-single/index.html#untrusted-deserialization-protection

@peterchenadded
Copy link

@kwart thanks for the clear explanation. The cve read like it was possible.

Good to know it's not with the enterprise license if additional security settings are configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants