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

Security Manager disables ECDH/ECDHE cipher suites #18071

Closed
knn-k opened this issue Sep 3, 2023 · 4 comments
Closed

Security Manager disables ECDH/ECDHE cipher suites #18071

knn-k opened this issue Sep 3, 2023 · 4 comments
Assignees

Comments

@knn-k
Copy link
Contributor

knn-k commented Sep 3, 2023

Enabling Security Manager with a custom policy file disables ECDH/ECDHE cipher suites with OpenJ9 v0.40 Java 11.0.20.1.
It did not happen with OpenJ9 v0.38 Java 11.0.19.

[ Steps to reproduce ]

  1. Comment out the "os.name" line in the default java.policy file in jdk-11.0.20.1+1/conf/security.
    // permission java.util.PropertyPermission "os.name", "read";
  1. Run the following program with and without the option -Djava.security.manager. It lists the supported cipher suites.
import javax.net.ssl.*;

public class PrintCipherSuites {
	public static void main(String[] args) {
		SSLSocketFactory ssf = (SSLSocketFactory)SSLSocketFactory.getDefault();
		String[] scs = ssf.getSupportedCipherSuites();

		System.out.println("-- Supported cipher suites --");
		for (String cipher : scs) {
			System.out.println(cipher);
		}
	}
}

[ Result ]

  • java PrintCipherSuites prints 49 cipher suites
  • java -Djava.security.manager PrintCipherSuites prints only 23 cipher suites
  • The difference between the two is TLS_ECDH_ and TLS_ECDHE_ cipher suites.

It was introduced by ibmruntimes/openj9-openjdk-jdk11#650, which calls System.getProperty("os.name").

@keithc-ca
Copy link
Contributor

The system property os.name is supposed to be readable by all code, but I noticed some tests apply a security policy that disallows that. I'll fix this via appropriate use of doPrivileged().

@knn-k
Copy link
Contributor Author

knn-k commented Sep 5, 2023

@keithc-ca Thank you.
I would like the fix to be in the v0.41 branch, too.

@pshipton
Copy link
Member

pshipton commented Sep 5, 2023

I would like the fix to be in the v0.41 branch, too.

I'll take care of that.

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

No branches or pull requests

3 participants