Skip to content

Agent can reach runner CoreCLR debug/diagnostic IPC endpoints via shared /tmp (token theft) #11684

Backlog

Description

@pelikhan

Summary

AWF exposes the GitHub Actions runner's .NET (CoreCLR) debugger and diagnostic IPC endpoints to the agent. Please confirm whether AWF should guarantee this cannot happen, and if so, handle it in the sandbox itself rather than relying on gh-aw.

Background

Depi Security (Backdooring Codex, Nov 2026) used prompt injection to get a shell inside an agent sandbox, then escaped through the runner's CoreCLR IPC endpoints:

  • ${TMPDIR:-/tmp}/clr-debug-pipe-<pid>-<key>-in and -out (debugger FIFOs, created by Runner.Worker and Runner.Listener)
  • ${TMPDIR:-/tmp}/dotnet-diagnostic-<pid>-<key>-socket (diagnostic IPC socket)

These are owner-only (0600/0700), but anything running as the same UID can open them. They read runner memory (__environ) to recover ACTIONS_RUNTIME_TOKEN and GITHUB_TOKEN, then used the runtime token to poison the Actions cache that a release workflow consumed.

Why AWF is affected

  • Host /tmp is mounted read-write into the agent: /tmp:/host/tmp:rw (system-mounts.ts), and /tmp:/tmp:rw in non-chroot mode (workspace-mounts.ts).
  • The agent runs as the host runner UID (getSafeHostUid), so the owner-only permissions do not protect these endpoints.
  • --exclude-env does not help, because the tokens are read from process memory, not the environment.

Current mitigation in gh-aw (host-side)

gh-aw now emits a fail-closed Remove .NET runtime IPC endpoints step immediately before every agent and threat-detection run. The step:

  • unlinks clr-debug-pipe-* FIFOs and dotnet-diagnostic-* sockets in $TMPDIR, /tmp, and any directory that /proc/net/unix lists as holding one of these diagnostic sockets;
  • fails the job if any endpoint the runner UID can open remains.

I tested it against a live dotnet process: all endpoints were removed, the process kept running, and a container mounting that directory saw none.

This is a host-side workaround with known gaps:

  • It runs once, before AWF starts. Any .NET process started later on the host (setup or post steps, services, dotnet build-server, MSBuild nodes) creates new endpoints in the shared /tmp while the agent is running.
  • On ARC/DinD, the /tmp bind source is resolved on the dind daemon side, which the runner-side step may not see.
  • It does not check what the agent can actually see from inside the container.

Requests

  1. Clarify the contract. Should AWF guarantee that the agent cannot reach host process IPC in shared directories (/tmp, $HOME, $RUNNER_TEMP)? Please document it in the AWF security model.
  2. Support it in AWF. Options to consider:
    • Stop sharing host /tmp with the agent. Use a private tmpfs or overlay, and bind-mount only the specific subpaths AWF needs (for example /tmp/gh-aw, /tmp/awf-runner-bin).
    • If host /tmp must stay shared, hide or deny clr-debug-pipe-* and dotnet-diagnostic-* inside the container, for example in the entrypoint before dropping privileges, or with a seccomp/LSM rule that blocks connecting to FIFOs and sockets you don't own.
    • Run the agent under a UID that differs from the runner's, so same-UID access no longer applies. This likely conflicts with workspace write access.
  3. Add a runtime self-check. Before AWF launches the agent command, assert from inside the container that no clr-debug-pipe-* or dotnet-diagnostic-* entries are visible under /tmp, /host/tmp or $TMPDIR, and fail closed if any are. Add a regression test that starts a .NET process on the host and checks that the agent cannot see or open its endpoints.

Once AWF guarantees this, gh-aw can keep its host-side step as defense in depth or drop it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions