fix CRITICAL xxe (XML External Entity) issues identified in sonarcloud 62/122762/1
authorwr148d <wr148d@att.com>
Tue, 20 Jul 2021 16:30:30 +0000 (12:30 -0400)
committerwr148d <wr148d@att.com>
Tue, 20 Jul 2021 16:30:30 +0000 (12:30 -0400)
Issue-ID: AAI-3346
Signed-off-by: wr148d <wr148d@att.com>
Change-Id: I76532cc11f348f9c267f5cd87e061b139ce4e7e0

src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java

index 7c9b4c2..73709f6 100644 (file)
@@ -287,6 +287,7 @@ public class ModelArtifact extends AbstractModelArtifact {
         StringWriter sw = new StringWriter();
         TransformerFactory transFact = TransformerFactory.newInstance();
         transFact.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+        transFact.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
         Transformer t = transFact.newTransformer();
         t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
         t.transform(new DOMSource(node), new StreamResult(sw));