Search code examples
springsecurityspring-securityspring-batchpom.xml

How to resolve CVEs in spring-batch-core 4.0.1.RELEASE?


I noticed that I cannot create an issue on the spring-batch github and I could not create a topic on the Spring forum so I was redirected here.

I have this in my pom.xml file as explained on Spring.io's Batch tutorial

<dependency>
    <groupId>org.springframework.batch</groupId>
    <artifactId>spring-batch-core</artifactId>
    <version>4.0.1.RELEASE</version>
</dependency>

And when I run the mvn dependency-check:check I see these issues

spring-tx-5.0.0.RELEASE.jar

spring-batch-core-4.0.1.RELEASE.jar

I ran mvn dependency:build-classpath -Dmdep.outputFile=cp.txt the offending jars above are located in my classpath. Then ran 'mvn dependency:tree` but did not see the offending jars.

mvn dependency:tree 2>&1 | egrep -i 'batch-core|spring-tx'

I tried googling some of the core CVEs which said to upgrade spring-mvc which I don't even have in my project but I explicitly defined it anyway. My spring version is set to the latest 4.x and even upgrading to 5.x still throws the vulnerability because spring-batch-core's latest version is still vulnerable.

Am I doing something wrong in my pom file?


Solution

  • To start, none of those CVEs apply directly to Spring Batch or the spring-batch-core jar file. They are all related to Spring Framework and Spring MVC. Also, every one of those CVEs has been mitigated in the specified patch versions.

    If you have confirmed that your POM is bringing in the correct, non-vunlerable, version of Spring Framework, this is a case of a false positive and you'll need to configure whatever tool you're using to address this. If the artifact you are building as a result of the build process includes a vulnerable version of Spring Framework (or related components), then you do have an issue with your POM. We can help, but we need to see the POM in order to do so.