Skip to content

Commit 4fb2b12

Browse files
author
Dennis Labordus
committed
Security issue fixed.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 85aa765 commit 4fb2b12

File tree

1 file changed

+1
-7
lines changed
  • service/src/main/java/org/lfenergy/compas/scl/validator/common

1 file changed

+1
-7
lines changed

service/src/main/java/org/lfenergy/compas/scl/validator/common/NsdocInfo.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import org.lfenergy.compas.scl.validator.exception.SclValidatorException;
77

8-
import javax.xml.XMLConstants;
98
import javax.xml.stream.XMLInputFactory;
109
import javax.xml.stream.XMLStreamException;
1110
import javax.xml.stream.events.StartElement;
@@ -27,13 +26,8 @@ public class NsdocInfo {
2726
public NsdocInfo(File file) {
2827
try (var fis = new FileInputStream(file)) {
2928
var factory = XMLInputFactory.newInstance();
30-
// to be compliant, completely disable DOCTYPE declaration:
31-
factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
32-
// or completely disable external entities declarations:
29+
// Completely disable external entities declarations:
3330
factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
34-
// or prohibit the use of all protocols by external entities:
35-
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
36-
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
3731

3832
var reader = factory.createXMLEventReader(fis);
3933

0 commit comments

Comments
 (0)