[Bug]: root module still requires vulnerable github.com/moby/go-archive v0.2.0 (GHSA-hfg8-hc9c-6c3h)

Open Beginner friendly
#3,913 1 comment 6 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start in the root go.mod and verify the github.com/moby/go-archive requirement. Update it to v0.3.3, run go mod tidy and make tidy-all, then run the full test suite. Done means the root module no longer requires the vulnerable v0.2.0 and all tests pass.

Written by the indexing model from the issue text.

Description

Testcontainers version

v0.42.0

Using the latest Testcontainers version?

No

(Checked: the root module's go.mod on the latest release, v0.44.0, still requires github.com/moby/go-archive v0.2.0, so this affects the latest version too.)

Host OS

macOS (Darwin)

Host arch

ARM (arm64)

Go version

1.26.5

Docker version
Client:
 Version:           29.2.1
 API version:       1.53
 Go version:        go1.25.6
 Git commit:        a5c7197
 Built:             Mon Feb  2 17:16:37 2026
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.61.0 (219004)
 Engine:
  Version:          29.2.1
  API version:      1.53 (minimum version 1.44)
  Go version:       go1.25.6
  Git commit:       6bc6209
  Built:            Mon Feb  2 17:16:47 2026
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v2.2.1
  GitCommit:        dea7da592f5d1d2b7755e3a161be07f43fad8f75
 runc:
  Version:          1.3.4
  GitCommit:        v1.3.4-0-gd6d73eb8
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Docker info
Client:
 Version:    29.2.1
 Context:    desktop-linux
 Debug Mode: false

Server:
 Server Version: 29.2.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Kernel Version: 6.12.68-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.653GiB
What happened?

github.com/moby/go-archive is vulnerable to a tar path-traversal issue (GHSA-hfg8-hc9c-6c3h): a crafted tar archive can write outside the intended extraction directory. Fixed as of go-archive v0.3.0, with v0.3.1–v0.3.3 fixing several extraction regressions the v0.3.0 hardening itself introduced (rejecting valid absolute symlinks/hardlinks, broken device-node permission handling) — so v0.3.3 is the version worth targeting, not just the first patched release.

The root testcontainers-go module still requires go-archive v0.2.0:

$ curl -s https://raw.githubusercontent.com/testcontainers/testcontainers-go/v0.44.0/go.mod | grep go-archive
	github.com/moby/go-archive v0.2.0

I noticed this repo's own Dependabot has already bumped go-archive to v0.3.0 in three of the per-database submodules:

  • #3852 (/modules/valkey)
  • #3854 (/modules/vearch)
  • #3857 (/modules/solr)

but not in the root module, which is what consumers using the generic container API (testcontainers.Run, not a modules/* wrapper) actually depend on. Every dependent of the root module will keep getting flagged for this until the root module's own requirement is bumped.

I've locally verified that bumping to v0.3.3 in the root module is a drop-in change: go get github.com/moby/[email protected] + go mod tidy only changes the go-archive requirement itself (no other version conflicts), and the full test suite (including tests that spin up real containers) builds and passes against it.

Would you accept a PR bumping github.com/moby/go-archive to v0.3.3 (or later) in the root module's go.mod? Happy to open one following the contributing guide (conventional-commit PR title with the security type, make tidy-all) if that's welcome — wanted to check per the "find or open an issue first" guidance before doing so.

Relevant log output
$ curl -s https://raw.githubusercontent.com/testcontainers/testcontainers-go/v0.44.0/go.mod | grep go-archive
	github.com/moby/go-archive v0.2.0

(Surfaced via GitHub Dependabot on a downstream repo depending on the root testcontainers-go module.)

Additional information
Dominant language
Go
Stars
5k
Forks
660
Avg merge
3d 11h
Merged PRs (30d)
48

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from testcontainers/testcontainers-go

All issues in testcontainers/testcontainers-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.