File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/main/java/de/doubleslash/keeptime/common Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,22 @@ public static String getSvgPathWithXMl(Resources.RESOURCE resource){
2424 String svgPath ;
2525 Document document ;
2626 DocumentBuilderFactory dbf = DocumentBuilderFactory .newInstance ();
27- /* try {
27+ try {
2828 dbf .setFeature ("http://apache.org/xml/features/disallow-doctype-decl" , true );
2929 } catch (ParserConfigurationException e ) {
3030 throw new RuntimeException (e );
31- }*/
31+ }
32+
33+ /* Fixes Sonar Vulnerability Issue "XML parsers should not be vulnerable to XXE attacks"
34+ * XML standard allows the use of entities, declared in the DOCTYPE of the document, which can be internal or external.
35+ Problem:
36+ When parsing the XML file, the content of the external entities is retrieved from an external storage such as the file system or network,
37+ which may lead, if no restrictions are put in place, to arbitrary file disclosures or server-side request forgery (SSRF) vulnerabilities.
3238
39+ Solution:
40+ *It’s recommended to limit resolution of external entities by using one of these solutions:
41+ If DOCTYPE is not necessary, completely disable all DOCTYPE declarations.
42+ * */
3343
3444 DocumentBuilder db ;
3545
You can’t perform that action at this time.
0 commit comments