@@ -107,9 +107,23 @@ public class ZUGFeRDVisualizer {
|
|||||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||||
//REDHAT
|
//REDHAT
|
||||||
//https://www.blackhat.com/docs/us-15/materials/us-15-Wang-FileCry-The-New-Age-Of-XXE-java-wp.pdf
|
//https://www.blackhat.com/docs/us-15/materials/us-15-Wang-FileCry-The-New-Age-Of-XXE-java-wp.pdf
|
||||||
dbf.setAttribute(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||||
dbf.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
try
|
||||||
dbf.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
|
{
|
||||||
|
dbf.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException e)
|
||||||
|
{
|
||||||
|
LOGGER.warn("Property: \"Access external DTD\" not supported.");
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dbf.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException e)
|
||||||
|
{
|
||||||
|
LOGGER.warn("Property: \"Access external schema\" not supported.");
|
||||||
|
}
|
||||||
|
|
||||||
//OWASP
|
//OWASP
|
||||||
//https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html
|
//https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html
|
||||||
|
|||||||
Reference in New Issue
Block a user