I am trying to fix all of the vulnerabilities that veracode has listed out in my web application. I am stuck on this particular vulnerability which I actually have no idea about. 'Improper Restriction of XML External Entity Reference'. Cal any please help me and explain on the issue with the code and a way by which we can solve this?
Object objec = null;
try {
JAXBContext jContext = JAXBContext.newInstance(context);
Unmarshaller unmarshaller = jContext.createUnmarshaller();
InputStream inputStream = new ByteArrayInputStream(xml.getBytes());
objec = unmarshaller.unmarshal(inputStream); //Vulnerability reported in this line
} catch (JAXBException e) {
e.printStackTrace();
}
return objec;
}