Self-hosted GHAR should not require a repository- or organization-wide token to remove itself
Nobody has claimed this yet.
- 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
- Upon successful
./config.shregistration that does require a registration token the./config.shshould be able to automatically obtain and persist (in a manner similar to/home/runner/.credentialsand other security material) a single-use token scoped to the registered runner only. - When
./config.sh removeis then called without the--tokenargument, 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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