containerd v1 replace points at a personal fork that upstream 1.7 will not fix; it comes from the stereoscope fork
Summary
go.mod replaces github.com/containerd/containerd (v1) with a personal fork:
replace github.com/containerd/containerd => github.com/Retr0-Xd/containerd v0.0.0-20260322054632-16583c73e9b8It was added in 1c531c92 (the moby/buildkit 0.26.1 → 0.28.1 bump) and is load-bearing, but it can no longer be retired by moving to an upstream 1.7 release, and it keeps the containerd v1 fixes released since March out of the build. The v1 module is only in the graph because of the pinned stereoscope fork, so the cleanest exit looks like updating that fork rather than the containerd one. Opening this as an issue because the choice of fork is a maintainer decision.
Why the replace exists
The buildkit bump moved github.com/opencontainers/runtime-spec to v1.3.0, where LinuxPids.Limit changed from int64 to *int64. containerd 1.7's oci.WithPidsLimit does not compile against that. The pinned commit is upstream release/1.7 as of 2026-03-21 plus one patch, oci: make WithPidsLimit runtime-spec compatible.
Upstream will not take that patch on 1.7: containerd/containerd#13087 was closed, with the maintainers noting that the 1.7 branch is supported for a limited set of use cases (primarily Kubernetes, which does not consume this part of containerd as a library). Dropping the replace and moving to the newest 1.7 release still fails:
$ go mod edit -dropreplace github.com/containerd/containerd
$ go get github.com/containerd/[email protected] && go mod tidy && go build ./...
# github.com/containerd/containerd/oci
.../[email protected]/oci/spec_opts.go:1548:34: cannot use limit (variable of type int64) as *int64 value in assignmentWhat the fork misses
The pinned commit predates every 1.7 release since v1.7.30 (v1.7.31 on 2026-04-14 through v1.7.36 on 2026-09-24). Advisories against the v1 module fixed in that window:
| Advisory | Severity | Fixed in |
|---|---|---|
| GHSA-fqw6-gf59-qr4w | medium | 1.7.32 |
| GHSA-xhf5-7wjv-pqxp | critical | 1.7.33 |
| GHSA-jpcc-p29g-p8mq | medium | 1.7.33 |
| GHSA-7jxh-36q5-gcqv | medium | 1.7.35 |
| GHSA-rp3h-jf77-q9p4 | medium | 1.7.35 |
| GHSA-pg57-6jwg-q645 | medium | 1.7.36 |
To be clear about exposure: most of these are in containerd's CRI plugin, i.e. the daemon side. Kubescape only links containerd v1 as a client library, so I have not shown any of them to be reachable through Kubescape. The practical cost is that the binary ships a containerd v1 that no upstream release covers, which scanners and SBOM consumers will keep reporting, and future 1.7 fixes cannot land either. #2895 already ran into this and left the replace for manual review.
Where containerd v1 comes from
go mod why -m github.com/containerd/containerd:
github.com/kubescape/kubescape/v4/core/cautils
github.com/anchore/grype/grype/pkg
github.com/anchore/stereoscope
github.com/anchore/stereoscope/internal/containerd
github.com/containerd/containerdEvery v1 importer in the build graph is under github.com/anchore/stereoscope, which is replaced with github.com/matthyx/stereoscope v0.0.0-20250916161743-dd57158479de. That fork is 2 commits ahead of upstream (schema v1 support, add maxImageSize support for img.Read()) and 210 behind, and its go.mod requires github.com/containerd/containerd v1.7.28.
Upstream stereoscope moved to github.com/containerd/containerd/v2 between v0.1.15 and v0.1.18; v0.1.22 (the version Kubescape's go.mod names) and the latest v0.3.2 use v2 only.
Possible way forward
- Rebase the two stereoscope fork patches onto a current upstream stereoscope (or upstream them), so the fork no longer pulls containerd v1.
- Drop the
github.com/containerd/containerdreplace; with no v1 importer left, the module should leave the graph.
This probably has to move together with the grype version (currently v0.104.1; latest is v0.119.0), since grype constrains the stereoscope version. I have not attempted that bump. Happy to help with it if this direction sounds right.
Source: kubescape/kubescape