summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Platt <jonathan.platt@att.com>2021-07-15 12:38:16 -0400
committerJonathan Platt <jonathan.platt@att.com>2021-07-19 12:12:54 -0400
commit6dfa45c5b883af5d9d3371f303513180cefa6f86 (patch)
tree037fc616ee636ea2ace4253a3e276583e3304dd2
parent136a85c040adc383bf63342f5e59d5632ecb5dd1 (diff)
Fix XML external entity vulnerability (CCSDK-3324)
Disabled XML external entity references to resolve XML external entity vulnerability in 'SdncUebCallback.java' Issue-ID: CCSDK-3324 Signed-off-by: Jonathan Platt <jonathan.platt@att.com> Change-Id: If959e915921042fdd0ba2ff16e167005ba1beed8
-rw-r--r--northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
index 8c3a290e0..ba060924e 100644
--- a/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
+++ b/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java
@@ -1194,9 +1194,10 @@ public class SdncUebCallback implements INotificationCallback {
outFile = File.createTempFile("tmp", "xml");
TransformerFactory factory = TransformerFactory.newInstance();
- factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- //factory.setFeature("http://xml.org/sax/features/external-general-entities", false); -- breaks transform
- //factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ // To remediate XML external entity vulnerability, completely disable external entities declarations:
+ factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+ factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
Source xslt = new StreamSource(new File(xsltPath));
Transformer transformer = factory.newTransformer(xslt);
Source text = new StreamSource(inFile);