--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java Thu May 09 20:31:47 2013 +0100
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java Mon May 13 17:50:14 2013 -0400
@@ -230,6 +230,21 @@
} catch (Exception e) {
throw new URIReferenceException(e);
}
+
+ // guard against RetrievalMethod loops
+ if ((data instanceof NodeSetData) && Utils.secureValidation(context)) {
+ NodeSetData nsd = (NodeSetData)data;
+ Iterator i = nsd.iterator();
+ if (i.hasNext()) {
+ Node root = (Node)i.next();
+ if ("RetrievalMethod".equals(root.getLocalName())) {
+ throw new URIReferenceException(
+ "It is forbidden to have one RetrievalMethod point " +
+ "to another when secure validation is enabled");
+ }
+ }
+ }
+
return data;
}