Skip to content

screen the connection factory JNDI name in JMSTargetAddressPolicy - #1339

Merged
robertlazarski merged 1 commit into
apache:masterfrom
kali834x:jms-confac-jndi-scheme
Nov 21, 2026
Merged

robertlazarski merged 1 commit into
apache:masterfrom
kali834x:jms-confac-jndi-scheme

Conversation

@kali834x

Copy link
Copy Markdown
Contributor

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.

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.
@robertlazarski
robertlazarski merged commit 59d66df into apache:master Nov 21, 2026
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

Successfully merging this pull request may close these issues.

2 participants