[java-plugin-shibd-saml] 01/02: Clone metadata from resolver due to subsequent manipulation.

Codeberg noreply at shibboleth.net
Mon Nov 16 16:03:31 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/2f0e2ac532c39fc4ade5f95db946fcd5c9a53287

commit 2f0e2ac532c39fc4ade5f95db946fcd5c9a53287
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Mon Nov 16 09:52:29 2026 -0500

    Clone metadata from resolver due to subsequent manipulation.
---
 .../net/shibboleth/sp/saml/saml2/profile/impl/AddMetadata.java     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/impl/AddMetadata.java b/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/impl/AddMetadata.java
index f1b38ef..1fddbd4 100644
--- a/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/impl/AddMetadata.java
+++ b/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/impl/AddMetadata.java
@@ -38,7 +38,6 @@ import net.shibboleth.sp.Agent;
 import net.shibboleth.sp.Application;
 import net.shibboleth.sp.context.AgentRequestContext;
 import net.shibboleth.sp.ddf.DDF;
-import net.shibboleth.sp.messaging.RemotedHttpServletRequestResponseContext;
 import net.shibboleth.sp.profile.AbstractApplicationAction;
 import net.shibboleth.sp.saml.saml2.SAML2ProtocolSupportService;
 import net.shibboleth.sp.saml.saml2.profile.config.MetadataPublishingProfileConfiguration;
@@ -48,6 +47,7 @@ import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.exception.VelocityException;
 import org.opensaml.core.criterion.EntityIdCriterion;
 import org.opensaml.core.xml.XMLObject;
+import org.opensaml.core.xml.io.MarshallingException;
 import org.opensaml.core.xml.io.UnmarshallingException;
 import org.opensaml.core.xml.util.XMLObjectSupport;
 import org.opensaml.messaging.context.MessageContext;
@@ -421,9 +421,10 @@ public class AddMetadata extends AbstractApplicationAction {
                         final EntityDescriptor ret = component.getComponent().resolveSingle(criteria);
                         if (ret == null) {
                             ActionSupport.buildEvent(profileRequestContext, EventIds.MESSAGE_PROC_ERROR);
+                            return null;
                         }
-                        return ret;
-                    } catch (final ServiceException|ResolverException e) {
+                        return XMLObjectSupport.cloneXMLObject(ret);
+                    } catch (final ServiceException|ResolverException | MarshallingException | UnmarshallingException e) {
                         log.error("{} Error resolving metadata from service for {}", getLogPrefix(), issuerId, e);
                         ActionSupport.buildEvent(profileRequestContext, EventIds.MESSAGE_PROC_ERROR);
                         return null;

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


More information about the commits mailing list