Skip to content

CVE-2023-44487: Replace com.github.tomakehurst:wiremock* with org.wiremock:wiremock* #427

@yeikel

Description

@yeikel

What problem are you trying to solve?

Starting with wiremock 3.x, the coordinates of the dependency changed

From

<dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock-jre8</artifactId>
        </dependency>

To :

 <dependency>
 <groupId>org.wiremock</groupId>
  <artifactId>wiremock</artifactId>
 </dependency>

Using 2.x versions puts teams at risk such as CVE-2023-44487

Sample diff :

diff --git a/pom.xml b/pom.xml
         <!--Testing framework to allow for mocking external service calls-->
         <dependency>
-            <groupId>com.github.tomakehurst</groupId>
-            <artifactId>wiremock-jre8</artifactId>
-            <version>2.35.1</version>
+            <groupId>org.wiremock</groupId>
+            <artifactId>wiremock</artifactId>
+            <version>3.3.1</version>
             <scope>test</scope>
         </dependency>
     </dependencies>

In my case, changing the coordinates was enough but there are some breaking changes we need to be aware of as well. See the release notes for more details

Describe the solution you'd like

  1. Replace the coordinates
  2. Migrate deprecated APIs

Additional context

  • v3 no longer supports Java 8 so this recipe should not be applied for Java 8 projects

Relevant :

https://www.cve.org/CVERecord?id=CVE-2023-44487
https://blog.cloudflare.com/technical-breakdown-http2-rapid-reset-ddos-attack/

openrewrite/rewrite-java-dependencies#58

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions