File tree 1 file changed +8
-4
lines changed
src/main/java/hudson/plugins/nested_view
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 31
31
import java .io .BufferedInputStream ;
32
32
import java .io .ByteArrayInputStream ;
33
33
import java .io .InputStream ;
34
+
35
+ import javax .xml .XMLConstants ;
34
36
import javax .xml .transform .Transformer ;
35
37
import javax .xml .transform .TransformerException ;
36
38
import javax .xml .transform .TransformerFactory ;
@@ -505,10 +507,12 @@ public void updateByXml(Source source) throws IOException {
505
507
// this allows us to use UTF-8 for storing data,
506
508
// plus it checks any well-formedness issue in the submitted
507
509
// data
508
- Transformer t = TransformerFactory .newInstance ()
509
- .newTransformer ();
510
- t .transform (source ,
511
- new StreamResult (out ));
510
+ TransformerFactory factory = TransformerFactory .newInstance ();
511
+ factory .setFeature (XMLConstants .FEATURE_SECURE_PROCESSING , true );
512
+ factory .setAttribute (XMLConstants .ACCESS_EXTERNAL_DTD , "" );
513
+ factory .setAttribute (XMLConstants .ACCESS_EXTERNAL_STYLESHEET , "" );
514
+ Transformer t = factory .newTransformer ();
515
+ t .transform (source , new StreamResult (out ));
512
516
out .close ();
513
517
} catch (TransformerException e ) {
514
518
throw new IOException2 ("Failed to persist configuration.xml" , e );
You can’t perform that action at this time.
0 commit comments