Skip to content

Commit

Permalink
fix: disable external entities resolution (#276)
Browse files Browse the repository at this point in the history
* fix: disable external entities resolution

* fix: disable external entities resolution
  • Loading branch information
kuisathaverat authored Oct 23, 2022
1 parent 79bc2d7 commit 3902210
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ public void updateIdPMetadata() throws IOException {
URLConnection urlConnection = ProxyConfiguration.open(new URL(url));
try (InputStream in = urlConnection.getInputStream()) {
TransformerFactory tf = TransformerFactory.newInstance();
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
Expand Down

0 comments on commit 3902210

Please sign in to comment.