Description
I attempted to set up CodeQL in the EchoSVG project (css4j/echosvg#37) but found a false positive claiming a critical Java XXE vulnerability in:
The code uses FEATURE_SECURE_PROCESSING
(as well as other configurations) together with a custom resolver that, by default, is configured to not retrieve remote DTDs. The approach is described here:
https://css4j.github.io/resolver.html
And that's similar to the resolver approach that OWASP describes, but instead of a no-op it is using a preloaded subset of safe DTDs. That's consistent with SonarQube S2755:
And use an entity resolver (and optionally an XML Catalog) to resolve only trusted entities.
Given that CodeQL uses OWASP as a guide for the identification of security vulnerabilities, it would seem reasonable to have a way to avoid false positives when a custom EntityResolver is being used.