Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
Merged
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 @@ -88,12 +88,8 @@ public JAXBElement<?> readFrom(Class<JAXBElement<?>> type,
unmarshaller = decorateUnmarshaller(type, annotations, mediaType, unmarshaller);

// Disable external entity resolution to prevent XXE attacks
try {
unmarshaller.setProperty(javax.xml.XMLConstants.ACCESS_EXTERNAL_DTD, "");
unmarshaller.setProperty(javax.xml.XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
} catch (IllegalArgumentException ex) {
throw new JAXBUnmarshalException("Failed to disable external entity resolution", ex);
}
unmarshaller.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
unmarshaller.setProperty(XMLInputFactory.SUPPORT_DTD, false);

if (needsSecurity())
{
Expand Down
Loading