Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 3d559fc

Browse files
authored
Merge pull request #301 from Azure/haozhan/fix-codeql
update by following copilot
2 parents 73a7ddc + a3fd54f commit 3d559fc

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

rules/rules-reviewed/eap7/eap6/tests/data/data-resteasy/JAXBElementProvider.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,8 @@ public JAXBElement<?> readFrom(Class<JAXBElement<?>> type,
8888
unmarshaller = decorateUnmarshaller(type, annotations, mediaType, unmarshaller);
8989

9090
// Disable external entity resolution to prevent XXE attacks
91-
try {
92-
unmarshaller.setProperty(javax.xml.XMLConstants.ACCESS_EXTERNAL_DTD, "");
93-
unmarshaller.setProperty(javax.xml.XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
94-
} catch (IllegalArgumentException ex) {
95-
throw new JAXBUnmarshalException("Failed to disable external entity resolution", ex);
96-
}
91+
unmarshaller.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
92+
unmarshaller.setProperty(XMLInputFactory.SUPPORT_DTD, false);
9793

9894
if (needsSecurity())
9995
{

0 commit comments

Comments
 (0)