actions / actions/runner

Self-hosted GHAR should not require a repository- or organization-wide token to remove itself

Open
#2,588 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug

This is a security bug

GHAR currently requires a repository- or organization-wide token to be able to remove itself via ./config.sh remove.
It does, however, present a security issue where GHAR cannot self-remove in an unattended manner without hosting a token on the runner. The runner itself is naturally insecure and thus a potentially malicious code could obtain an organization-wide token that is able to remove any runner in the repository or organization.

Expected behavior

  1. Upon successful ./config.sh registration that does require a registration token the ./config.sh should be able to automatically obtain and persist (in a manner similar to /home/runner/.credentials and other security material) a single-use token scoped to the registered runner only.
  2. When ./config.sh remove is then called without the --token argument, the single-use token obtained in [1] should be used to unregister self.

Runner Version and Platform

Version of your runner?
2.304.0

OS of the machine running the runner? OSX/Windows/Linux/...
Linux

What's not working?

N/A

Job Log Output

N/A

Runner and Worker's Diagnostic Logs

N/A

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ./config.sh and the existing /home/runner/.credentials handling described in the issue. Trace the registration and removal flows to determine where a runner-scoped, single-use token could be persisted and consumed. Done means removal works without --token while avoiding an organization-wide token on the runner.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, github-actions
Domain
devops, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.