Fix JMX RMI connector startup failure introduced by CVE-2026-46495 hardening#651
Merged
Merged
Conversation
The CVE-2026-46495 fix set two mutually exclusive JMX environment properties at once in RmiConnector.configureJmxDeserializationProtection: "jmx.remote.rmi.server.credential.types" and "jmx.remote.rmi.server.credentials.filter.pattern". The JDK rejects this combination, so RMIJRMPServerImpl threw IllegalArgumentException, startConnectorNoClientCertificate() failed and jmxRmiConnectorNoClientCertificate stayed null. This broke JMX tests (JmxPrivilegeTestCase.setUp -> JmxTestCase.getJmxConnectionHandler: "Expecting actual not to be null"). Keep only the credentials-scoped JEP 290 filter "jmx.remote.rmi.server.credentials.filter.pattern" (maxdepth=3;maxarray=2;java.lang.String;!*), which is stricter than the credential-types allowlist, and drop the conflicting credential.types property and its unused constants. Update RmiAuthenticatorTest accordingly and assert credential.types is not set. The deserialization protection is preserved: the filter allows only String/String[] payloads (length <= 2) and RmiAuthenticator still validates a two-element String[] before binding.
maximthomas
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The hardening introduced in commit
7e3a75903159153c877daeb2952a552701e38044(CVE-2026-46495 OpenDJ Unauthenticated RCE via Java Deserialization in JMX RMI)
prevented the JMX RMI connector from starting on the JDK. This PR fixes the
startup regression while keeping the deserialization protection in place.
Problem
RmiConnector.configureJmxDeserializationProtection(...)populated the JMXenvironment map with two mutually exclusive properties at the same time:
jmx.remote.rmi.server.credential.typesjmx.remote.rmi.server.credentials.filter.patternThe JDK forbids specifying both. As a result
RMIJRMPServerImpl's constructorthrew:
Because
startConnectorNoClientCertificate()failed, thejmxRmiConnectorNoClientCertificatereference stayednull, and the JMX testsuite failed during setup:
Fix
In
RmiConnector:jmx.remote.rmi.server.credential.typesenvironment property(and the now-unused
JMX_REMOTE_RMI_SERVER_CREDENTIAL_TYPESandJMX_CREDENTIAL_TYPESconstants).jmx.remote.rmi.server.credentials.filter.pattern=maxdepth=3;maxarray=2;java.lang.String;!*. This filter is stricter than thecredential-types allowlist because it also constrains array length and
nesting depth.
not reintroduced.
In
RmiAuthenticatorTest:credentialTypesAreDefensivelyCopiedtest and thecredential.typesassertions.configuresCredentialDeserializationProtectiontoguarantee
jmx.remote.rmi.server.credential.typesis not set.Security impact
The deserialization protection against CVE-2026-46495 is fully preserved:
String/String[]payloads upto length 2 and depth 3, rejecting any other class (
!*).RmiAuthenticator.authenticate(...)still validates that the credentials area two-element
String[]before any bind attempt.The filter remains scoped to the credentials object only, so legitimate JMX RMI
traffic (MBean operations, notifications) is unaffected.
Testing
IllegalArgumentExceptionwith an isolatedRMIConnectorServerstart using both properties.isActive() == true) with onlythe credentials filter pattern configured.
RmiAuthenticatorTestand the JMX test suite (JmxPrivilegeTestCase,JmxTestCase) compile and run again.