testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

[Bug]: Vulnerable dependency commons-compress 1.24.0

Open veita opened this issue 1 year ago • 7 comments

Module

Core

Testcontainers version

1.19.5

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86_64

Docker version

Podman 4.3.1

What happened?

Testcontainers pulls in common-compress 1.24.0.

https://github.com/testcontainers/testcontainers-java/blob/main/core/build.gradle#L76

Additional Information

  • https://www.cve.org/CVERecord?id=CVE-2024-25710
  • https://www.cve.org/CVERecord?id=CVE-2024-26308

veita avatar Feb 20 '24 07:02 veita

Anyone coming across this, please follow the discussion at #8354. The commons-compress dependency won't be updated here for now.

marcelstoer avatar Feb 22 '24 09:02 marcelstoer

Apache have released patch version 1.26.1 of commons-compress last week that may address this?

COMPRESS-659: TarArchiveOutputStream should use Commons IO Charsets instead of Commons Codec Charsets.

I was able to successfully upgrade the commons-compress version in a project of mine to 1.26.1 that was previously failing on 1.26.0 with:

java.lang.NoClassDefFoundError: org/apache/commons/codec/Charsets

	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.<init>(TarArchiveOutputStream.java:212)
	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.<init>(TarArchiveOutputStream.java:157)
	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.<init>(TarArchiveOutputStream.java:147)
	at org.testcontainers.containers.ContainerState.copyFileToContainer(ContainerState.java:350)
	at org.testcontainers.containers.ContainerState.copyFileToContainer(ContainerState.java:331)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:441)

hailuand avatar Mar 12 '24 21:03 hailuand

Do I understand this correctly, it will probably not be updated before spring has updated it to 1.26.1?

blommish avatar Apr 07 '24 10:04 blommish

Is any reason not resolve this by updating to 1.26.1? NoClassDefFoundError has been resolved in that version.

antonmos avatar Jun 27 '24 22:06 antonmos

It also works with 1.27.0. Please update.

angelo-v avatar Aug 14 '24 08:08 angelo-v