File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/history Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 30
30
import java .util .List ;
31
31
import java .util .logging .Level ;
32
32
import java .util .logging .Logger ;
33
+ import javax .xml .XMLConstants ;
33
34
import javax .xml .parsers .DocumentBuilder ;
34
35
import javax .xml .parsers .DocumentBuilderFactory ;
35
36
import javax .xml .parsers .ParserConfigurationException ;
@@ -123,6 +124,10 @@ private Document getInfoDocument() {
123
124
if (executor .exec () == 0 ) {
124
125
try {
125
126
DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance ();
127
+ // Prohibit the use of all protocols by external entities:
128
+ factory .setAttribute (XMLConstants .ACCESS_EXTERNAL_DTD , "" );
129
+ factory .setAttribute (XMLConstants .ACCESS_EXTERNAL_SCHEMA , "" );
130
+
126
131
DocumentBuilder builder = factory .newDocumentBuilder ();
127
132
document = builder .parse (executor .getOutputStream ());
128
133
} catch (SAXException saxe ) {
You can’t perform that action at this time.
0 commit comments