# containerd v2.0.7

2025-11-06 · [Original release notes](https://github.com/containerd/containerd/releases/tag/v2.0.7) · [Full summary](https://ratatosk.io/en/releases/containerd/v2.0.7)

Security 6 (high 1) · Breaking changes 2 · Important fixes 11 · Enhancements 2 · Dependency updates 2 · Other changes 15

## Security (6)

### [high] containerd fixes overly broad directory permissions

- Affects: containerd v2 installations with affected directories, including installations with a configured `temp` directory
- [CVE-2024-25621](https://www.cve.org/CVERecord?id=CVE-2024-25621), [GHSA-pwhc-rpq9-4c8w](https://github.com/containerd/containerd/security/advisories/GHSA-pwhc-rpq9-4c8w)

Before the fix, these directories could have broader permissions that let local host users access metadata, content, or Kubernetes local volume contents. Existing affected directories and newly created ones are changed to `0o700`; `/run/containerd` and `/run/containerd/io.containerd.runtime.v2.task` remain at `0o711`.

>   * [**GHSA-pwhc-rpq9-4c8w**](https://github.com/containerd/containerd/security/advisories/GHSA-pwhc-rpq9-4c8w)

### [medium] containerd CRI Attach goroutine leak fixed

- Affects: setups using containerd's CRI Attach implementation
- [CVE-2025-64329](https://www.cve.org/CVERecord?id=CVE-2025-64329), [GHSA-m6hq-p25p-ffr2](https://github.com/containerd/containerd/security/advisories/GHSA-m6hq-p25p-ffr2)

Repeated CRI Attach calls, such as `kubectl attach`, could leak goroutines and increase containerd memory use, potentially exhausting host memory.

>   * [**GHSA-m6hq-p25p-ffr2**](https://github.com/containerd/containerd/security/advisories/GHSA-m6hq-p25p-ffr2)

### `runc` console-device mount protection fixed

- Affects: containers that allocate a console while using affected `runc` versions
- [GHSA-qw9x-cqr3-wc7r](https://github.com/advisories/GHSA-qw9x-cqr3-wc7r)

When an attacker can influence a bind mount of `/dev/pts/$n` to `/dev/console`, affected `runc` versions could make a path that should be read-only or masked writable. The advisory's upstream fixes address this issue, but the release material does not identify the `runc` version included in containerd v2.0.7.

>   * [**GHSA-qw9x-cqr3-wc7r**](https://github.com/opencontainers/runc/security/advisories/GHSA-qw9x-cqr3-wc7r)

### runc `/proc` write redirection fixed

- Affects: setups using affected runc versions with containers that use shared mounts
- [GHSA-cgrx-mc8f-2prm](https://github.com/advisories/GHSA-cgrx-mc8f-2prm)

A racing container with shared mounts could redirect runc writes to `/proc`, including sysctl writes, to other procfs files. The advisory says this could also happen during `docker buildx build` when parallel containers use custom shared mounts.

>   * [**GHSA-cgrx-mc8f-2prm**](https://github.com/opencontainers/runc/security/advisories/GHSA-cgrx-mc8f-2prm)

### runc `maskedPaths` mount verification fix listed

- Affects: containers with file paths configured in runc `maskedPaths`
- [CVE-2025-31133](https://www.cve.org/CVERecord?id=CVE-2025-31133), [GHSA-9493-h29p-rfm2](https://github.com/advisories/GHSA-9493-h29p-rfm2)

When runc used the container's `/dev/null` to mask files, a race could replace it with a symlink and mount an arbitrary source inside the container, or delete it so `maskedPaths` was silently skipped.

>   * [**GHSA-9493-h29p-rfm2**](https://github.com/opencontainers/runc/security/advisories/GHSA-9493-h29p-rfm2)

### Runtime shim sets `bootstrap.json` creation mode to `0644`

- Affects: setups where the runtime shim creates `bootstrap.json` (Inferred)

> * **Create bootstrap.json with 0644 permission** ([#12184](https://github.com/containerd/containerd/pull/12184))
> * Create bootstrap.json with 0644 permission ([#12184](https://github.com/containerd/containerd/pull/12184))
>   * [`009622e04`](https://github.com/containerd/containerd/commit/009622e0424fa4234d67272339fb7e282c302190) fix: create bootstrap.json with 0644 permission

## Breaking changes (2)

### Containerd directory permissions tightened

- Affects: Installations using `/var/lib/containerd`, `config.TempDir`, `/run/containerd/io.containerd.grpc.v1.cri`, or `/run/containerd/io.containerd.sandbox.controller.v1.shim`; task directories for userns-remapped or other containers (Inferred)

Previously, the first four directories had modes `0o711`, `0o711`, `0o755`, and `0o711`, respectively; after the upgrade, they use mode `0o700`. Task-directory parents remain at `0o711`, while task directories use `0o710` for userns-remapped containers and `0o700` otherwise.

Evidence: “- 0o700 for non-userns-remapped containers - 0o710 for userns-remapped containers with the remapped root group as the owner group.” https://github.com/containerd/containerd/commit/8cd112d8295bafcf4a992816ff9e07f5a78ff71b

>   * [`8cd112d82`](https://github.com/containerd/containerd/commit/8cd112d8295bafcf4a992816ff9e07f5a78ff71b) Fix directory permissions

### Temporary idmapped bind mounts are read-only

- Affects: overlayfs setups using user namespaces and temporary idmapped bind mounts

This prevents accidental modification of the temporary mounts.

Evidence: “The temporary idmap'ed bind mounts r/o and not MNT_DETACHED, which prevents accidental modification and makes unmount semantics more clear” https://github.com/containerd/containerd/pull/12223

>   * [`1c32accd7`](https://github.com/containerd/containerd/commit/1c32accd71d34e3cb5798214adf26911609d11f1) Make ovl idmap mounts read-only

## Important fixes (11)

### containerd-shim-runc-v2 fix for lost container logs

- Affects: containers using `containerd-shim-runc-v2` (Inferred)

When I/O closed quickly during init or exec process deletion, the 2-second drain wait could lose container logs. The shim now waits up to 10 seconds for I/O to drain and logs an error if it still times out.

> * Fix lost container logs from quickly closing io ([#12376](https://github.com/containerd/containerd/pull/12376))
>   * [`f953ee8a3`](https://github.com/containerd/containerd/commit/f953ee8a3c1feeaa60a3c9d386afa424040d56de) bugfix:fix container logs lost because io close too quickly
> * **Fix lost container logs from quickly closing io** ([#12376](https://github.com/containerd/containerd/pull/12376))

### Duplicate pod sandbox cleanup path fixed

- Affects: CRI pod sandbox task cleanup

During pod-sandbox task cleanup, the event subscriber could start a second cleanup goroutine alongside the sandbox container’s individual goroutine, causing concurrent `task.Delete` calls and, in the worst case, a shim leak. The subscriber is now disabled during cleanup, avoiding that duplicate cleanup path.

> * **Disable event subscriber during task cleanup** ([#12406](https://github.com/containerd/containerd/pull/12406))

### `ctr shim shutdown` subcommand added

- Affects: setups using the `ctr shim` command

It sends a shutdown request only when no container is active. `--api-version` accepts 2 or 3 and defaults to 3.

> * **Disable event subscriber during task cleanup** ([#12406](https://github.com/containerd/containerd/pull/12406))
> * Disable event subscriber during task cleanup ([#12406](https://github.com/containerd/containerd/pull/12406))
>   * [`2a2329cbd`](https://github.com/containerd/containerd/commit/2a2329cbd02dc5e1a3010730fab01c618dad768c) cri/server/podsandbox: disable event subscriber

### User-namespace image `VOLUME` copy-up fixed

- Affects: CRI workloads using user namespaces with image `VOLUME` mounts that need copying

During copy-up, files are copied without UID/GID transformations; the copied file has UID/GID `0:0` inside the container.

> * **Fix userns with container image VOLUME mounts that need copy** ([#12241](https://github.com/containerd/containerd/pull/12241))
> * Fix userns with container image VOLUME mounts that need copy ([#12241](https://github.com/containerd/containerd/pull/12241))
>   * [`3212afc2f`](https://github.com/containerd/containerd/commit/3212afc2f2d464157bcb24663360ee7dfa7207e6) integration: Add test for directives with userns
>   * [`b855c6e10`](https://github.com/containerd/containerd/commit/b855c6e10372eb43d51186ab156cdce3d9eefb04) cri: Fix userns with Dockerfile VOLUME mounts that need copy

### CRI Attach monitor leak fixed

- Affects: CRI container Attach sessions for containers without `stdout` or `stderr` output (Inferred)

Before the fix, the monitor goroutine never finished when Attach connected to a container with no `stdout` or `stderr` output. After the upgrade, context cancellation releases the monitor and removes the stream keys from the `stdout` and `stderr` write groups.

>   * [`4d1edf4ad`](https://github.com/containerd/containerd/commit/4d1edf4addf8c31b096680f04fee499cabc75439) fix goroutine leak of container Attach

### Temporary idmapped mount leaks prevented by cleanup retries

- Affects: user namespaces with overlayfs and temporary idmapped mounts

When unmounting temporary bind mounts for idmapped directories failed, the single cleanup attempt could leave a mount leaked. Cleanup now retries after an unmount error.

>   * [`05c0c99f4`](https://github.com/containerd/containerd/commit/05c0c99f432b341152b54ce49d9b43c5cf3d131f) core/mount: Retry unmounting idmapped directories

### ID-mapped overlay preparation cleanup on errors

- Affects: user-namespace ID-mapped overlay mounts (Inferred)

An error during preparation could leave temporary mount locations or mounts uncleaned. Now, resources created before an error are cleaned up when preparation returns the error.

>   * [`47205f814`](https://github.com/containerd/containerd/commit/47205f814d552a4eea9935375dd2f0874e107e5b) core/mount: Properly cleanup on doPrepareIDMappedOverlay errors

### Nil cleanup call on idmapped overlay errors fixed

- Affects: idmapped overlay mounts

When overlay preparation returned an error with a nil cleanup function, cleanup had been deferred before the error check and could be called as nil. The mount path now returns the preparation error before deferring cleanup.

>   * [`6f4abd970`](https://github.com/containerd/containerd/commit/6f4abd970aeea241f07edc1e0fd74f69a9a05979) core/mount: Don't call nil function on errors

### Overlayfs layer idmapping uses fewer bind mounts

- Affects: overlayfs setups using user namespaces and multiple lower layers (Inferred)

When preparing an idmapped overlayfs with multiple lower layers, each layer was previously idmapped separately, creating more temporary bind mounts. The directory containing all layers is now idmapped once, reducing the bind mounts per overlayfs and improving performance.

>   * [`a2f0d65d7`](https://github.com/containerd/containerd/commit/a2f0d65d78871832da6d2aa452aeeb180cd6d8f5) core/mount: Only idmap once per overlayfs, not per layer

### `pidfd` leak in `UnshareAfterEnterUserns` fixed

- Affects: setups that call `UnshareAfterEnterUserns` (Inferred)

> * Fix pidfd leak in UnshareAfterEnterUserns ([#12178](https://github.com/containerd/containerd/pull/12178))
>   * [`5bec0a332`](https://github.com/containerd/containerd/commit/5bec0a33297ad485f96116efb333ea750a27c926) sys: fix pidfd leak in UnshareAfterEnterUserns

### Early pidfd support check in `UnshareAfterEnterUserns`

- Affects: setups invoking `UnshareAfterEnterUserns` on kernels without pidfd support (Inferred)

The function returns `kernel doesn't support pidfd` when the kernel lacks pidfd support.

> * Fix pidfd leak in UnshareAfterEnterUserns ([#12178](https://github.com/containerd/containerd/pull/12178))
>   * [`5bec0a332`](https://github.com/containerd/containerd/commit/5bec0a33297ad485f96116efb333ea750a27c926) sys: fix pidfd leak in UnshareAfterEnterUserns
> * **Fix pidfd leak in UnshareAfterEnterUserns** ([#12178](https://github.com/containerd/containerd/pull/12178))

## Enhancements (2)

- `SystemdCgroup` added to CRI default runtime options
- Per-host `dial_timeout` setting added to hosts TOML

## Dependency updates (2)

2 more, none mentioning security

- `* **Update runc binary to v1.3.3** ([#12479](https://github.com/containerd/containerd/pull/12479))`
- `` * runc:Update runc binary to v1.3.1 ([#12275](https://github.com/containerd/containerd/pull/12275)) * [`75c13ee3f`](https://github.com/containerd/containerd/commit/75c13ee3fc3657ee419395e20820d1cbd4bb2f88) runc:Update runc binary to v1.3.1 ``

## Other changes (15)

- v2.0.7 release notes and mailmap updated
- CI Go versions updated to include Go 1.24.9 and 1.25.3
- GitHub Actions runner images updated for the basic binaries build and most jobs
- CI directory exclusions now use `issues.exclude-dirs`
- CI lint tooling updated to `golangci-lint` v1.64.2
- CI `golangci-lint` action updated to 6.5.0
- CI updated to Fedora 43
- CI skips the `ubuntu-24.04-arm` runner on private repositories
- Additional fuzzers removed from the CI instrumentation repository
- install-runhcs-shim checks out the requested target
- Cleanup test added for `DoPrepareIDMappedOverlay()`
- CI Go versions updated to 1.23.12 and 1.24.6
- Pidfd duplication error reporting fixed
- Windows CI test setup changed to address intermittent failures
- Windows Server 2025 CI coverage removed

---

Summaries are produced by AI, so they can be wrong, and they are provided without warranty.
