Skip to content

CopyToContainer regression in 29.7.0: "path escapes from parent" when copying into paths that traverse /var/run → /run symlink #53258

Description

@RainerEls

Description

After upgrading to Docker Engine 29.7.0, the Gitea act_runner (gitea/runner:2.3.0) fails at "Set up job" when copying action content into the job container via the CopyToContainer API. The error is:

failed to copy content to container: Error response from daemon: statat var/run/act/actions/60120a02682c189ab422cd7ab32ed5be6df0b0b7b1c29c9ac2bfd7454e25932c/.git: path escapes from parent

The runner copies action files into /var/run/act/actions/ inside the container. Since virtually all standard Linux images symlink /var/run → /run, the path traversal is rejected as a path escape.

Downgrading to 29.6.1 immediately resolves the issue, confirming this is a regression introduced in 29.7.0.

Note: plain docker cp on the host does not reproduce the error — the regression is specific to the CopyToContainer API (tar archive extraction) path, not the CLI docker cp path.

Reproduce

  1. Start a Gitea instance with act_runner using gitea/runner:2.3.0 against Docker Engine 29.7.0.
  2. Run any workflow that uses actions/checkout@v4 or later.
  3. The job fails immediately at "Checkout repository" with the error above.
    To confirm the regression is in CopyToContainer and not docker cp:
# This succeeds on 29.7.0 — plain docker cp is NOT affected
docker run -d --name test-symlink ubuntu:24.04 sleep 3600
mkdir -p /tmp/test-action/.git/refs
echo "ref: refs/heads/main" > /tmp/test-action/.git/HEAD
docker cp /tmp/test-action/. test-symlink:/var/run/act/actions/testaction/
# → Successfully copied
 
# Downgrade to 29.6.1 → Gitea runner works correctly
sudo apt install \
  docker-ce=5:29.6.1-1~ubuntu.24.04~noble \
  docker-ce-cli=5:29.6.1-1~ubuntu.24.04~noble \
  containerd.io
# → Actions pass again

Expected behavior

CopyToContainer should successfully copy content into paths under /var/run/ inside a container, resolving in-container symlinks (such as the common /var/run → /run) before applying os.Root path validation, as was done in the 29.5.2 fix (#52655).

docker version

Client: Docker Engine - Community
 Version:          29.7.0
 API version:      1.55
 Go version:       go1.26.5
 Git commit:       c1eba93
 Built:            Thu Jul 30 20:20:28 2026
 OS/Arch:          linux/amd64
 Context:          default
 
Server: Docker Engine - Community
 Engine:
  Version:         29.7.0
  API version:     1.55 (minimum version 1.24)
  Go version:      go1.26.5
  Git commit:      4b5cb71
  Built:           Thu Jul 30 20:20:28 2026
  OS/Arch:         linux/amd64
  Experimental:    false
 containerd:
  Version:         v2.2.6
  GitCommit:       11ce9d5f3c68c941867e82890e93e815c1304f1b
 runc:
  Version:         1.3.6
  GitCommit:       v1.3.6-0-g491b69ba
 docker-init:
  Version:         0.19.0
  GitCommit:       de40ad0

docker info

Client: Docker Engine - Community
 Version:    29.6.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.36.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.3.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 64
  Running: 58
  Paused: 0
  Stopped: 6
 Images: 89
 Server Version: 29.6.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 11ce9d5f3c68c941867e82890e93e815c1304f1b
 runc version: v1.3.6-0-g491b69ba
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-136-generic
 Operating System: Linux Mint 22
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 31.13GiB
 Name: BL-MINIPC-1
 ID: 9cbb19bf-9740-4068-b1df-f3c0a83eec94
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 172.31.0.0/16, Size: 24
   Base: 192.168.0.0/16, Size: 24
 Firewall Backend: iptables
  EnableUserlandProxy: true
  UserlandProxyPath: /usr/bin/docker-proxy

Additional Info

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.version/29.7

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions