DEV Community

Query Filter
Query Filter

Posted on

exec-1

// FIX START: Secure DocumentBuilderFactory against XXE vulnerabilities
            dbFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
            dbFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
            dbFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
            dbFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
            dbFactory.setXIncludeAware(false);
            dbFactory.setExpandEntityReferences(false);
            // FIX END
Enter fullscreen mode Exit fullscreen mode

Top comments (0)