Gitea Actions is HIGHLY insecure due to binding of docker.sock into all containers (= root on host) #10753

Closed
opened 2025-11-02 09:17:20 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @vitalif on GitHub (Apr 30, 2023).

Description

Hi.

I already submitted it as https://gitea.com/gitea/act_runner/issues/167
But I want to duplicate it here because I think it's VERY important. The problem is:

Gitea act_runner is TERRIBLY INSECURE, it allows all job containers to:

  1. access the docker daemon on host via the socket.
  2. bind host directories into the container.

This allows any job to escape from the container and easily get root privileges on the runner host. Jobs are basically untrusted code so they have to be isolated correctly.

Some ways of how you can escape the container using docker.sock include:

  • starting a privileged container
  • using host namespaces
  • using a bind mount to host directory to overwrite system files

It may be rather OK for act itself because it's only a local testing tool, but for act_runner it's a real blocker.

You should forbid bind mounts in job descriptions (named volumes are probably ok) and remove docker socket access. The latter will probably break docker-related steps, so for them you'll have to use DinD or newer tools like Kaniko or Buildah/Podman.

I like Gitea and I use it for a long time so probably I'll try to patch and test it on my server and submit a PR, but anyway, in the current state Gitea Actions SHOULD NOT be used in production.

Gitea Version

1.19.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Official linux amd64 binary in systemd.
Testing act_runner in a separate VM.

Database

MySQL

Originally created by @vitalif on GitHub (Apr 30, 2023). ### Description Hi. I already submitted it as https://gitea.com/gitea/act_runner/issues/167 But I want to duplicate it here because I think it's VERY important. The problem is: Gitea act_runner is **TERRIBLY INSECURE**, it allows all job containers to: 1) access the docker daemon on host via the socket. 2) bind host directories into the container. This allows any job to escape from the container and easily get root privileges on the runner host. Jobs are basically untrusted code so they have to be isolated correctly. Some ways of how you can escape the container using docker.sock include: - starting a privileged container - using host namespaces - using a bind mount to host directory to overwrite system files It may be rather OK for `act` itself because it's only a local testing tool, but for act_runner it's a real blocker. You should forbid bind mounts in job descriptions (named volumes are probably ok) and remove docker socket access. The latter will probably break docker-related steps, so for them you'll have to use DinD or newer tools like Kaniko or Buildah/Podman. I like Gitea and I use it for a long time so probably I'll try to patch and test it on my server and submit a PR, but anyway, in the current state Gitea Actions SHOULD NOT be used in production. ### Gitea Version 1.19.1 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Official linux amd64 binary in systemd. Testing act_runner in a separate VM. ### Database MySQL
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 09:17:20 -06:00
Author
Owner

@wolfogre commented on GitHub (Apr 30, 2023):

Related:

@wolfogre commented on GitHub (Apr 30, 2023): Related: - https://gitea.com/gitea/act/pulls/52 - https://github.com/nektos/act/pull/1760
Author
Owner

@wolfogre commented on GitHub (Jun 21, 2023):

Since act runner supports dind now: gitea/act_runner:nightly-dind-rootless or gitea/act_runner:latest-dind-rootless, see https://hub.docker.com/r/gitea/act_runner/tags

I think it's time to close this issue.

@wolfogre commented on GitHub (Jun 21, 2023): Since act runner supports dind now: `gitea/act_runner:nightly-dind-rootless` or `gitea/act_runner:latest-dind-rootless`, see https://hub.docker.com/r/gitea/act_runner/tags I think it's time to close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10753