Colm O hEigeartaigh created CXF-9278:
----------------------------------------

             Summary: Disable JMS createSecurityContext by default
                 Key: CXF-9278
                 URL: https://issues.apache.org/jira/browse/CXF-9278
             Project: CXF
          Issue Type: Improvement
            Reporter: Colm O hEigeartaigh
            Assignee: Colm O hEigeartaigh
             Fix For: 4.3.0


The JMS transport has createSecurityContext=true by default (JMSConfiguration). 
For each incoming request (JMSDestination) and reply (JMSConduit), 
SecurityContextFactory builds a SecurityContext whose user principal is taken 
from the JMSXUserID message property (or JMS_TIBCO_SENDER for TIBCO EMS).
 
JMSXUserID is an ordinary message property. Unless the JMS broker is configured 
to overwrite it with the authenticated user of the sending connection, any 
client that can send to the destination can set it to any value. CXF then 
exposes that value as the authenticated principal via 
SecurityContext.getUserPrincipal(), so application code or interceptors that 
rely on the principal name can be given a spoofed identity.
 
isUserInRole() always returns false, so role-based authorization is not 
affected, and a SecurityContext set later by a real authentication mechanism 
(e.g. WS-Security) replaces it.
 
Proposed change (for the next minor/major release, not a patch release):
* Change the default of JMSConfiguration.createSecurityContext to false.
* Document the change in the migration notes: deployments that rely on the 
JMSXUserID-based principal should set createSecurityContext=true and make sure 
their broker validates or populates JMSXUserID.
 
Existing JMS tests (JMSDestinationTest) already set createSecurityContext 
explicitly, so little test change is expected.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to