I am getting an XML External Entity Reference (XXE) vulnerability from the code scan audit(Veracode) while unmarshaling an Element.
public static <T> T unMarshal(org.w3c.dom.Element content, Class<T> clazz) throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(clazz);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
return (T) unmarshaller.unmarshal(content, clazz).getValue();
}
How can I fix Improper Restriction of XML External Entity Reference ('XXE') in the above code ?