Skip to content

Conversation

@ZachChuba
Copy link
Contributor

Code hygene and clearing falsely flagged CVEs

Upgrade jackson and snakeyaml to the latest version. Aside from providing code hygene, these two dependencies are flagged by FOSS scanning tools as having critical severity CVEs. Although not exploitable in testcontainers, this causes a headache for developers.

This is to address Issue #9289

@ZachChuba ZachChuba requested a review from a team May 9, 2025 11:16
Copy link

@codefish1 codefish1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ive doubled checked, these are the latest versions as of today.

Thanks

@ZachChuba
Copy link
Contributor Author

@eddumelendez Can you enable the tests CI flows so we can confirm this does not break and review?

@yeikel
Copy link

yeikel commented May 28, 2025

@eddumelendez Can you enable the tests CI flows so we can confirm this does not break and review?

The easiest way to run CI and get that feedback is to send a pull request to your own fork's main and let CI run

I did that in my fork + your changes here: yeikel#1

Unfortunately, your changes are not passing some of the workflows

ie:


Gradle Test Executor 2 > ArtemisContainerTest > defaultCredentials FAILED
    java.util.ServiceConfigurationError: org.testcontainers.dockerclient.DockerClientProviderStrategy: Provider org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy could not be instantiated
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586)
        at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
        at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
        at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
        at java.base/java.lang.Iterable.forEach(Iterable.java:74)
        at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:152)
        at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:196)
        at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:108)
        at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
        at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
        at org.testcontainers.activemq.ArtemisContainerTest.defaultCredentials(ArtemisContainerTest.java:24)

        Caused by:
        java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonKey

There are also other failures

        Caused by:
        java.lang.NoSuchMethodError: 'com.fasterxml.jackson.annotation.OptBoolean com.fasterxml.jackson.annotation.JsonProperty.isRequired()'

Refer to the link above to see the full CI Run. Example: https://github.com/yeikel/testcontainers-java/actions/runs/15290585561/job/43009689378?pr=1

I also sent you an invite in case it is more convenient to just push to my fork

@yeikel
Copy link

yeikel commented May 28, 2025

It seems that the issue is a mismatch as docker-java-api is bringing jackson-annotations:2.10.3

Although we may be able to overwrite that, it seems safer to upgrade docker-java-api first as is closely developed and tested with testcontainers-java

See docker-java/docker-java#2447

@ZachChuba
Copy link
Contributor Author

Let me know when that version is published and I'll add it to the build

@gabrieljones
Copy link

Let me know when that version is published and I'll add it to the build

@ZachChuba https://github.com/docker-java/docker-java/releases/tag/3.5.3 is published

@yeikel
Copy link

yeikel commented Jul 13, 2025

@ZachChuba I updated and tested the upgrade via yeikel#2. All the tests are passing now

Can you merge that patch in?

After that, we'll need help to get it reviewed

@ZachChuba
Copy link
Contributor Author

@yeikel Pushed the changes, in this PR

@ZachChuba ZachChuba changed the title Upgrade jackson to 2.19 and snakeyaml to 2.14 Upgrade jackson to 2.18 and snakeyaml to 2.14 Jul 14, 2025
@ZachChuba ZachChuba changed the title Upgrade jackson to 2.18 and snakeyaml to 2.14 Upgrade jackson to 2.18 and snakeyaml to 2.4 Jul 14, 2025
@yeikel
Copy link

yeikel commented Jul 14, 2025

@yeikel Pushed the changes, in this PR

As per GitHub, your branch is not up to date with main. Can you resolve that?

Code hygene and clearing falsely flagged CVEs
Also downgrade jackson to 2.18.4 to be aligned with docker-java-bom.
@ZachChuba ZachChuba force-pushed the upgrade-jackson-snakeyaml branch from d0adb4a to 14deb03 Compare July 15, 2025 16:59
@ZachChuba
Copy link
Contributor Author

Rebased

@eddumelendez eddumelendez added the dependencies Pull requests that update a dependency file label Jul 16, 2025
@eddumelendez eddumelendez changed the title Upgrade jackson to 2.18 and snakeyaml to 2.4 Update jackson, snakeyaml and docker-java versions Jul 16, 2025
@eddumelendez eddumelendez merged commit 9efe8f3 into testcontainers:main Jul 16, 2025
105 checks passed
@eddumelendez
Copy link
Member

Thank you so much for your contribution!

@eddumelendez eddumelendez added this to the next milestone Jul 16, 2025
@codefish1
Copy link

Thanks everyone, I've been following keenly.

Just need to wait for the release now, when do we think that would be

@yeikel
Copy link

yeikel commented Jul 16, 2025

Thank you so much for your contribution

@eddumelendez Thank you for the quick turnaround

Given that what motivated this change was a CVE, is there any chance we can push this out as a minor patch?

I noticed that it is part of the next milestone, but it is unclear what the criteria for the next release are.

Thank you!

@mstuy
Copy link

mstuy commented Jul 31, 2025

@eddumelendez Same question as above, is there any information on when the next release that contains this change will be available?

@baldimir
Copy link

Hi, when is this going to be available in a release, please? Or is there some roadmap with planned future releases, please?

@Rene2000k
Copy link

Hi, same request as above. It would be really helpful for us to have this as a patch release

@yeikel
Copy link

yeikel commented Oct 14, 2025

Hi team,

Sorry for the ping but we've been waiting since May

is there anything we can do to help this move forward as a release?

Thanks in advance!

@ZachChuba
Copy link
Contributor Author

@yeikel @Rene2000k I've been waiting as well, v2.0.1 is now released and shows 0 vulns on sonatype.

@yeikel
Copy link

yeikel commented Oct 24, 2025

@yeikel @Rene2000k I've been waiting as well, v2.0.1 is now released and shows 0 vulns on sonatype.

Yep, thank you. V2.0.0 is also not showing any vun for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file modules/k3s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants