Skip to content

Commit 3a26cd7

Browse files
committed
XMLConfiguration - block external schema resolution
1 parent 09081f5 commit 3a26cd7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

geowebcache/core/src/main/java/org/geowebcache/config/XMLConfiguration.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import java.util.logging.Logger;
4242
import java.util.stream.Collectors;
4343
import javax.annotation.Nullable;
44+
import javax.xml.XMLConstants;
4445
import javax.xml.parsers.DocumentBuilder;
4546
import javax.xml.parsers.DocumentBuilderFactory;
4647
import javax.xml.transform.Transformer;
@@ -742,6 +743,9 @@ static void validate(Node rootNode) throws SAXException, IOException {
742743
// TODO dont know why this one suddenly failed to look up, revert to
743744
// XMLConstants.W3C_XML_SCHEMA_NS_URI
744745
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
746+
// We normally don't need access to external schemas
747+
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
748+
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
745749
try (InputStream is = XMLConfiguration.class.getResourceAsStream("geowebcache.xsd")) {
746750

747751
Schema schema = factory.newSchema(new StreamSource(is));

0 commit comments

Comments
 (0)