Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ public void save(Savable object, OutputStream outputStream) throws IOException {
try {
TransformerFactory tfFactory = TransformerFactory.newInstance();
tfFactory.setAttribute("indent-number", indentSpaces);
// Disable external DTD and stylesheet access to prevent XXE attacks
tfFactory.setAttribute("accessExternalDTD", "");
tfFactory.setAttribute("accessExternalStylesheet", "");

Transformer transformer = tfFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
Expand Down
Loading