testcontainers-java: [Bug]: Vulnerable dependency commons-compress 1.24.0
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
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 20
- Comments: 18
Commits related to this issue
- APPPOCTOOL-35: commons-compress 1.27.1 fixing CVEs In folio-backend-testing upgrade commons-compress from 1.24 to 1.27.1. This upgrades the commons-compress version that testcontainers comes with fr... — committed to folio-org/applications-poc-tools by julianladisch 2 years ago
- Update commons-compress to 1.27.1 fixing CVEs https://github.com/testcontainers/testcontainers-java/issues/8338 https://www.cve.org/CVERecord?id=CVE-2024-25710 https://www.cve.org/CVERecord?id=CVE-20... — committed to urlaubsverwaltung/urlaubsverwaltung by derTobsch 2 years ago
- Update commons-compress to 1.27.1 fixing CVEs https://github.com/testcontainers/testcontainers-java/issues/8338 https://www.cve.org/CVERecord?id=CVE-2024-25710 https://www.cve.org/CVERecord?id=CVE-20... — committed to urlaubsverwaltung/urlaubsverwaltung by derTobsch 2 years ago
- Update commons-compress to 1.27.1 fixing CVEs https://github.com/testcontainers/testcontainers-java/issues/8338 https://www.cve.org/CVERecord?id=CVE-2024-25710 https://www.cve.org/CVERecord?id=CVE-20... — committed to urlaubsverwaltung/urlaubsverwaltung by derTobsch 2 years ago
- explicitly manage commons-compress version to address CVE-2024-25710, CVE-2024-26308 reports in transitive dependency, see also https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to aws-samples/java-on-aws by deki 2 years ago
- Update to latest springboot version. Added the artifact flyway-database-postgresql (https://github.com/flyway/flyway/issues/3780) Added dependency org.apache.commons.commons-compress (https://github.c... — committed to marcusfromsweden/plant-doctor by marcusfromsweden 2 years ago
- Update to latest springboot version. Added the artifact flyway-database-postgresql (flyway/flyway#3780) Added dependency org.apache.commons.commons-compress (testcontainers/testcontainers-java#8338) S... — committed to marcusfromsweden/plant-doctor by marcusfromsweden 2 years ago
- Move testcontainers into TypeTable To work around https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to openrewrite/rewrite-testing-frameworks by timtebeek 2 years ago
- Move testcontainers into TypeTable (#685) To work around https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to openrewrite/rewrite-testing-frameworks by timtebeek 2 years ago
- Security: Update commons-compress version TestContainers refuses to update to a non-vulnerable version. See https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to adobe/S3Mock by afranken 2 years ago
- Security: Update commons-compress version TestContainers refuses to update to a non-vulnerable version. See https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to adobe/S3Mock by afranken 2 years ago
- Security: Update commons-compress version TestContainers refuses to update to a non-vulnerable version. See https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to adobe/S3Mock by afranken 2 years ago
- Security: Update commons-compress version TestContainers refuses to update to a non-vulnerable version. See https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to adobe/S3Mock by afranken 2 years ago
- Security: Update commons-compress version TestContainers refuses to update to a non-vulnerable version. See https://github.com/testcontainers/testcontainers-java/issues/8338 — committed to adobe/S3Mock by afranken 2 years ago
- add commons dependency for mysql and maria db see: https://github.com/testcontainers/testcontainers-java/issues/8798 https://github.com/testcontainers/testcontainers-java/issues/8338#issuecomment-199... — committed to micronaut-projects/micronaut-starter by sdelamo a year ago
- add common compress for testcontainers see: https://github.com/testcontainers/testcontainers-java/issues/8798 https://github.com/testcontainers/testcontainers-java/issues/8338#issuecomment-1992649517 — committed to micronaut-projects/micronaut-starter by sdelamo a year ago
- add common compress for testcontainers (#2771) see: https://github.com/testcontainers/testcontainers-java/issues/8798 https://github.com/testcontainers/testcontainers-java/issues/8338#issuecomment-19... — committed to micronaut-projects/micronaut-starter by sdelamo a year ago
Any news on this?
We would really like to use Testcontainers again. But for security reasons we can’t. Unfortunately we can’t understand why the maintainers of Testcontainers refuse to upgrade the dependency. Sure, we could override this dependency ourself. But we are more concerned about how the maintainers deal with security issues. 😕
Anyone coming across this, please follow the discussion at #8354. The
commons-compressdependency won’t be updated here for now.When this does get upgraded it seems pretty clear that it should also become a shaded dependency. Libraries with other common libraries as dependencies are problematic.
It also works with 1.27.0. Please update.
The project continues to be vulnerable to CVE-2024-26308 and CVE-2024-25710.
What blocks merging a change like https://github.com/testcontainers/testcontainers-java/pull/9796? Can anyone share any reproducer if any issue is present?
@eddumelendez Let me respond here because this issue was referred in my PR. Thank you for looking into it.
I am following Maven repository vulnerabilities indication. If those are true, then testcontainers version 1.20.6 is referring to commons-compress version 1.24.0 that has direct CVE-2024-26308, CVE-2024-25710 and indirect CVE-2024-47554 vulnerabilities. So the question is the vulnerabilities of test dependencies can be considered as attack vector? Since those are executed as well (in test environment) then my answer is yes. Therefore the CVEs are not false positives.
Just thinking out loudly and approach this question from different angle… core/build.gradle is exposing commons-compress because the library is in dependencies api. This means it is part of the shipped APIs (https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation). Why is that? I don’t think testcontainers ambition is to provide a compression library. So if we could put this reference among implementation or shared then it must not affect on other libraries… unless they have been using this reference and those did not include among their own library references.
So I did an experiment.
So only org.testcontainers.utility.MountableFile is exposing commons-compress related object in transferTo method (inherited from org.testcontainers.images.builder.Transferable). This can be reduced to an abstract class (org.apache.commons.compress.archivers.ArchiveOutputStream).
Now the question is how can we hide or abstract this reference so that the need of commons-compress could be eliminated from the API completely to keep its usage internally in testcontainers?
That is a good temporary workaround. But a year later I was looking for some kind of official resolution.
Same issue for us - our security tooling does not allow us to disregard security vulnerabilities in our test code sadly.
In addition, this dependency should be “shaded” since it can conflict with other popular libraries like Apache POI which uses a newer version of commons-compress that is incompatible with test container and causes NoClassDefFound exception
Hi,
It still looks like Testcontainers is currently using commons-compress:1.24.0, which has some known vulnerabilities: 1. [GHSA-4g9r-vxhx-9pgx]: High severity (8.1) - Infinite loop in corrupted DUMP files causing a DoS. 2. [GHSA-4265-ccf5-phj5]: Medium severity (5.5) - OutOfMemoryError when unpacking broken Pack200 files.
These issues are resolved in
commons-compress:1.27.1. For now, I’m overriding the dependency in my project, but it would be great if this was updated in Testcontainers directly to help others avoid this issue.Thanks for all the work on this amazing project!
All the best, Martin
Apache have released patch version 1.26.1 of commons-compress last week that may address this?
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: