Skip to content

The gradle plugin doesn't identify versions accurately when pulling Tomcat as a zip dependency #3109

@edgarmolina2

Description

@edgarmolina2

Background
Tomcat's POM publication in maven central sets the appropriate version (see here)

  <groupId>org.apache.tomcat</groupId>
  <artifactId>tomcat</artifactId>
  <version>9.0.40</version>

However, the library isn't packaged as a Jar file, so in order to pull it we must add the zip qualifier like so:

dependencies {
    tomcat 'org.apache.tomcat:tomcat:9.0.41@zip'
}

Gradle is able to get the file which can be utilized as needed, for example decompressing it to deploy Tomcat as part of an automated CI/CD build.

The problem comes when the dependency check validates the NVD CPEs, the plugin doesn't seem determine the right version and reports tons of false positives, please see the attached report (dependency-check-report.zip).
Haven't investigated deeper if gradle is able to determine the version or not.

Build Script
Here is a simple script to reproduce the issue:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.owasp:dependency-check-gradle:6.0.4"
    }
}
 
repositories {
    mavenCentral()
}
 
apply plugin: "org.owasp.dependencycheck"
 
configurations {
    tomcat
}
 
dependencies {
    tomcat 'org.apache.tomcat:tomcat:9.0.41@zip'
}
 
dependencyCheck {
    failBuildOnCVSS = 5
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions