[java-plugin-shibd-saml] branch main updated: JSHIBDSAML-11 - Hardening

Codeberg noreply at shibboleth.net
Mon Nov 30 17:43:30 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-plugin-shibd-saml.

View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd-saml/commit/3325d93b568e52ff45cef0841f82db687c3dc0f0

The following commit(s) were added to refs/heads/main by this push:
     new 3325d93  JSHIBDSAML-11 - Hardening
3325d93 is described below

commit 3325d93b568e52ff45cef0841f82db687c3dc0f0
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Mon Nov 30 12:43:16 2026 -0500

    JSHIBDSAML-11 - Hardening
    
    Refactor to reuse "most" of the handlers, just differentiate sig check
---
 .../sp/consumer/saml2/artifact/artifact-beans.xml  | 23 ++--------------
 .../idp/flows/sp/consumer/saml2/ecp/ecp-beans.xml  | 23 ++--------------
 .../post-simplesign/post-simplesign-beans.xml      | 31 +++++-----------------
 .../flows/sp/consumer/saml2/post/post-beans.xml    | 23 ++--------------
 .../idp/flows/sp/consumer/saml2/saml2-beans.xml    | 30 +++++++++++++++++++--
 5 files changed, 40 insertions(+), 90 deletions(-)

diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-beans.xml
index 7334f57..e359bd9 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-beans.xml
@@ -34,26 +34,7 @@
         </constructor-arg>
     </bean>
 
-    <util:list id="shibboleth.sp.ResponseHandlers" scope="prototype">
-        <bean class="org.opensaml.saml.common.binding.security.impl.ReceivedEndpointSecurityHandler" scope="prototype"
-            p:checkDuringInit="false"
-            p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageReplaySecurityHandler" scope="prototype"
-            p:activationCondition="%{sp.saml.checkReplay:true}"
-            p:replayCache-ref="shibboleth.ReplayCache"
-            p:expires="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageLifetimeSecurityHandler" scope="prototype"
-            p:messageLifetime="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}"
-            p:clockSkew="%{sp.saml.clockSkew:%{sp.policy.clockSkew:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.impl.CheckMessageStatusHandler" scope="prototype" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.SAMLProtocolMessageXMLSignatureSecurityHandler" scope="prototype" />
-        <bean class="org.opensaml.messaging.handler.impl.CheckMandatoryIssuer" scope="prototype"
-            p:issuerLookupStrategy-ref="InboundEntityIDLookup" />
-        <bean class="org.opensaml.messaging.handler.impl.FunctionMessageHandler" scope="prototype">
-            <property name="functionLookupStrategy">
-                <bean class="net.shibboleth.saml.profile.config.navigate.messaging.MessageHandlerLookupFunction" />
-            </property>
-        </bean>
-    </util:list>
+    <bean id="shibboleth.sp.saml.TokenConsumer.SignatureHandler"
+        class="org.opensaml.saml.common.binding.security.impl.SAMLProtocolMessageXMLSignatureSecurityHandler" scope="prototype" />
 
 </beans>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/ecp/ecp-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/ecp/ecp-beans.xml
index e8bb5cc..de0beef 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/ecp/ecp-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/ecp/ecp-beans.xml
@@ -28,26 +28,7 @@
         </constructor-arg>
     </bean>
 
-    <util:list id="shibboleth.sp.ResponseHandlers" scope="prototype">
-        <bean class="org.opensaml.saml.common.binding.security.impl.ReceivedEndpointSecurityHandler" scope="prototype"
-            p:checkDuringInit="false"
-            p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageReplaySecurityHandler" scope="prototype"
-            p:activationCondition="%{sp.saml.checkReplay:true}"
-            p:replayCache-ref="shibboleth.ReplayCache"
-            p:expires="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageLifetimeSecurityHandler" scope="prototype"
-            p:messageLifetime="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}"
-            p:clockSkew="%{sp.saml.clockSkew:%{sp.policy.clockSkew:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.impl.CheckMessageStatusHandler" scope="prototype" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.SAMLProtocolMessageXMLSignatureSecurityHandler" scope="prototype" />
-        <bean class="org.opensaml.messaging.handler.impl.CheckMandatoryIssuer" scope="prototype"
-            p:issuerLookupStrategy-ref="InboundEntityIDLookup" />
-        <bean class="org.opensaml.messaging.handler.impl.FunctionMessageHandler" scope="prototype">
-            <property name="functionLookupStrategy">
-                <bean class="net.shibboleth.saml.profile.config.navigate.messaging.MessageHandlerLookupFunction" />
-            </property>
-        </bean>
-    </util:list>
+    <bean id="shibboleth.sp.saml.TokenConsumer.SignatureHandler"
+        class="org.opensaml.saml.common.binding.security.impl.SAMLProtocolMessageXMLSignatureSecurityHandler" scope="prototype" />
 
 </beans>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-beans.xml
index e05c5d6..51b53ee 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-beans.xml
@@ -25,30 +25,11 @@
         </constructor-arg>
     </bean>
 
-    <util:list id="shibboleth.sp.ResponseHandlers" scope="prototype">
-        <bean class="org.opensaml.saml.common.binding.security.impl.ReceivedEndpointSecurityHandler" scope="prototype"
-            p:checkDuringInit="false"
-            p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageReplaySecurityHandler" scope="prototype"
-            p:activationCondition="%{sp.saml.checkReplay:true}"
-            p:replayCache-ref="shibboleth.ReplayCache"
-            p:expires="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageLifetimeSecurityHandler" scope="prototype"
-            p:messageLifetime="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}"
-            p:clockSkew="%{sp.saml.clockSkew:%{sp.policy.clockSkew:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.impl.CheckMessageStatusHandler" scope="prototype" />
-        <bean class="org.opensaml.saml.saml2.binding.security.impl.SAML2HTTPPostSimpleSignSecurityHandler" scope="prototype"
-            p:checkDuringInit="false"
-            p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier"
-            p:parser-ref="shibboleth.ParserPool"
-            p:keyInfoResolver-ref="shibboleth.KeyInfoCredentialResolver" />
-        <bean class="org.opensaml.messaging.handler.impl.CheckMandatoryIssuer" scope="prototype"
-            p:issuerLookupStrategy-ref="InboundEntityIDLookup" />
-        <bean class="org.opensaml.messaging.handler.impl.FunctionMessageHandler" scope="prototype">
-            <property name="functionLookupStrategy">
-                <bean class="net.shibboleth.saml.profile.config.navigate.messaging.MessageHandlerLookupFunction" />
-            </property>
-        </bean>
-    </util:list>
+    <bean id="shibboleth.sp.saml.TokenConsumer.SignatureHandler"
+        class="org.opensaml.saml.saml2.binding.security.impl.SAML2HTTPPostSimpleSignSecurityHandler" scope="prototype"
+        p:checkDuringInit="false"
+        p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier"
+        p:parser-ref="shibboleth.ParserPool"
+        p:keyInfoResolver-ref="shibboleth.KeyInfoCredentialResolver" />
 
 </beans>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-beans.xml
index d2f993f..93f6187 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-beans.xml
@@ -25,26 +25,7 @@
         </constructor-arg>
     </bean>
 
-    <util:list id="shibboleth.sp.ResponseHandlers" scope="prototype">
-        <bean class="org.opensaml.saml.common.binding.security.impl.ReceivedEndpointSecurityHandler" scope="prototype"
-            p:checkDuringInit="false"
-            p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageReplaySecurityHandler" scope="prototype"
-            p:activationCondition="%{sp.saml.checkReplay:true}"
-            p:replayCache-ref="shibboleth.ReplayCache"
-            p:expires="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.MessageLifetimeSecurityHandler" scope="prototype"
-            p:messageLifetime="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}"
-            p:clockSkew="%{sp.saml.clockSkew:%{sp.policy.clockSkew:PT3M}}" />
-        <bean class="org.opensaml.saml.common.binding.impl.CheckMessageStatusHandler" scope="prototype" />
-        <bean class="org.opensaml.saml.common.binding.security.impl.SAMLProtocolMessageXMLSignatureSecurityHandler" scope="prototype" />
-        <bean class="org.opensaml.messaging.handler.impl.CheckMandatoryIssuer" scope="prototype"
-            p:issuerLookupStrategy-ref="InboundEntityIDLookup" />
-        <bean class="org.opensaml.messaging.handler.impl.FunctionMessageHandler" scope="prototype">
-            <property name="functionLookupStrategy">
-                <bean class="net.shibboleth.saml.profile.config.navigate.messaging.MessageHandlerLookupFunction" />
-            </property>
-        </bean>
-    </util:list>
+    <bean id="shibboleth.sp.saml.TokenConsumer.SignatureHandler"
+        class="org.opensaml.saml.common.binding.security.impl.SAMLProtocolMessageXMLSignatureSecurityHandler" scope="prototype" />
 
 </beans>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
index 11373ba..4171590 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
@@ -77,8 +77,34 @@
     <bean id="HandleResponse" class="net.shibboleth.sp.profile.impl.WebFlowMessageHandlerAdaptor" scope="prototype"
             c:executionDirection="INBOUND">
         <constructor-arg>
-            <bean class="org.opensaml.messaging.handler.impl.BasicMessageHandlerChain"
-                p:handlers-ref="shibboleth.sp.ResponseHandlers" />
+            <bean class="org.opensaml.messaging.handler.impl.BasicMessageHandlerChain">
+                <property name="handlers">
+                    <list>
+                        <bean class="org.opensaml.saml.common.binding.security.impl.ReceivedEndpointSecurityHandler" scope="prototype"
+                            p:checkDuringInit="false"
+                            p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier" />
+                        <bean class="org.opensaml.saml.common.binding.security.impl.MessageReplaySecurityHandler" scope="prototype"
+                            p:activationCondition="%{sp.saml.checkReplay:true}"
+                            p:replayCache-ref="shibboleth.ReplayCache"
+                            p:expires="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}" />
+                        <bean class="org.opensaml.saml.common.binding.security.impl.MessageLifetimeSecurityHandler" scope="prototype"
+                            p:messageLifetime="%{sp.saml.messageLifetime:%{sp.policy.messageLifetime:PT3M}}"
+                            p:clockSkew="%{sp.saml.clockSkew:%{sp.policy.clockSkew:PT3M}}" />
+                        <bean class="org.opensaml.saml.common.binding.impl.CheckMessageStatusHandler" scope="prototype" />
+                        
+                        <!-- Call out to binding-specific handler. -->
+                        <ref bean="shibboleth.sp.saml.TokenConsumer.SignatureHandler" />
+                        
+                        <bean class="org.opensaml.messaging.handler.impl.CheckMandatoryIssuer" scope="prototype"
+                            p:issuerLookupStrategy-ref="InboundEntityIDLookup" />
+                        <bean class="org.opensaml.messaging.handler.impl.FunctionMessageHandler" scope="prototype">
+                            <property name="functionLookupStrategy">
+                                <bean class="net.shibboleth.saml.profile.config.navigate.messaging.MessageHandlerLookupFunction" />
+                            </property>
+                        </bean>
+                    </list>
+                </property>
+            </bean>
         </constructor-arg>
         <property name="errorEvent">
             <util:constant static-field="org.opensaml.profile.action.EventIds.INVALID_MESSAGE" />

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list