Repository navigation
screen the connection factory JNDI name in JMSTargetAddressPolicy - #1339
Merged
Merged
Conversation
JMSOutTransportInfo.createJMSSender looks up transport.jms.ConnectionFactoryJNDIName from the target address when the sender has no configured factory for it, which the address can force by naming an unknown transport.jms.ConnectionFactory. The policy checked the destination, reply destination and provider URL for remote JNDI schemes but not this name, so an ldap: or rmi: URL there was resolved through the scheme's URL context factory.
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.
JMSTargetAddressPolicy.rejectionReason now also refuses a remote JNDI scheme in transport.jms.ConnectionFactoryJNDIName. JMSSender.sendMessage runs the policy on every JMS target address, including a decoupled wsa:ReplyTo when jms is among allowedResponseEndpointSchemes, but it only checked the destination name, transport.jms.ReplyDestination and java.naming.provider.url. JMSOutTransportInfo.createJMSSender looks the connection factory name up with InitialContext.lookup whenever the sender has no configured factory for the address, and the address can force that by naming an unknown transport.jms.ConnectionFactory, so jms:/Queue?transport.jms.ConnectionFactory=none&transport.jms.ConnectionFactoryJNDIName=ldap://host/x is resolved through the ldap URL context factory against the caller's directory (JNDI injection, CWE-917). the AXIS2-6062 substring guard that 2.0.2 replaced searched the whole address and caught this; the field-by-field replacement listed three of the four names an address resolves. ordinary factory names are unaffected. a scratch run with ActiveMQ's initial context factory and a local listener showed the policy accepting the address and createJMSSender connecting to the listener before, and the address refused with no connection after. JMSTargetAddressPolicyTest gains a case that fails before the change; the jms module (158 tests) passes with -Papache-release.