Closed hazemkmammu closed 4 years ago
it seems your JVM or the Sax parser that has ended up in your classpath doesn't know about this flag, while it should as it turns of entity expansion for DTD, which is an important security feature.
So the question is what JVM are you using and why you end up with what seems to be an instance of XPP Parser instead of the JVM built-in xml parser
Thanks for your quick reply. You were absolutely right. It is the XML parser.
We were using dom4j as a buildscript dependency. Dom4j declares optional transitive dependencies in a non gradle compliant fashion. All dom4j dependencies are being pulled. One of the dependencies, pull-parser, checks external XML entities if present on the classpath.
We fixed this by excluding all dom4j dependencies from being pulled until dom4j fix their optional dependency declaration.
class ClearDependencies implements ComponentMetadataRule {
void execute(ComponentMetadataContext context) {
context.details.allVariants { withDependencies { clear() } }
}
}
project.dependencies.components.withModule('org.dom4j:dom4j', ClearDependencies.class)
https://github.com/gradle/gradle/issues/13656 https://github.com/dom4j/dom4j/issues/99
Describe the bug Getting
org.xml.sax.SAXNotRecognizedException: unrecognized feature http://apache.org/xml/features/disallow-doctype-decl
when analyzing several different dependencies.Version of dependency-check used The problem occurs using version 5.3.2.1 of the gradle plugin
Log file
To Reproduce Add
compile group: 'commons-io', name: 'commons-io', version: '2.4'
orcompile group: 'log4j', name: 'log4j', version: '1.2.17'
Additional context Gradle version 6.5.1