How the attack works
Self-hosted runners are machines an organization registers to run GitHub Actions jobs. A repository-level runner can be added by an organization owner or anyone with admin access to the repository, an organization-level runner by an organization owner or a role with the runner management permission, and an enterprise-level runner by an enterprise owner. A job goes to a runner that matches the labels and group it asks for. Unlike GitHub-hosted runners, self-hosted runners are not clean, isolated machines: GitHub warns that whoever controls the runner environment can reach the job's secrets and its GITHUB_TOKEN, and that an organization runner can serve jobs from many repositories.
An attacker with that access registers a machine they control, or adds it to a runner group used by sensitive repositories, and collects the secrets of every job routed to it. The opposite direction is also used: in the Shai-Hulud 2.0 npm campaign of November 2025, Unit 42 reported that the malware registered infected machines as self-hosted runners and added a workflow that let the attackers run commands on them by opening GitHub discussions. Either way, a runner registered on an organization's repositories leaves the same audit log event. A just-in-time runner is added through a REST API call that generates a runner configuration, which GitHub records as configure_self_hosted_jit_runner at repository, organization or enterprise level, and a separate rule on this page reads that action.
What an attacker needs
- Admin access to a repository, or an organization owner, enterprise owner or runner management role for wider runners.
- A machine the attacker controls, or code execution on a machine that already holds a GitHub token with that access.
Impact
Secrets, tokens and source code of every job that runs on the runner, and a foothold on whatever network the runner sits in. When a victim's own machine is registered, the attacker gains remote command execution on it through ordinary GitHub events, which blends into normal developer traffic.
Detection rules
GitHub Just-in-Time Self-Hosted Runner Configured
Detects a just-in-time self-hosted runner being configured for a repository, an organization or an enterprise (repo.configure_self_hosted_jit_runner, org.configure_self_hosted_jit_runner, enterprise.configure_self_hosted_jit_runner). The REST API endpoint behind this action generates a configuration that is passed to the runner application at startup. GitHub lists the action separately from the registration actions that the other rule on this page reads, so a runner added this way has its own event. The caller needs admin access to the repository or the organization. A machine started with such a configuration can receive a job together with the secrets and the token of that job.
title: GitHub Just-in-Time Self-Hosted Runner Configured
id: 10a8661c-d444-46ab-9086-3bfd571407fa
status: experimental
description: >-
Detects a just-in-time self-hosted runner being configured for a
repository, an organization or an enterprise
(repo.configure_self_hosted_jit_runner,
org.configure_self_hosted_jit_runner,
enterprise.configure_self_hosted_jit_runner). The REST API endpoint behind
this action generates a configuration that is passed to the runner
application at startup. GitHub lists the action separately from the
registration actions that the other rule on this page reads, so a runner
added this way has its own event. The caller needs admin access to the
repository or the organization. A machine started with such a
configuration can receive a job together with the secrets and the token
of that job.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners
- https://docs.github.com/en/actions/reference/security/secure-use
- https://attack.mitre.org/techniques/T1677/
author: Forestall
date: 2026-11-18
tags:
- attack.execution
- attack.t1677
logsource:
product: github
service: audit
detection:
selection:
action:
- repo.configure_self_hosted_jit_runner
- org.configure_self_hosted_jit_runner
- enterprise.configure_self_hosted_jit_runner
condition: selection
falsepositives:
- Autoscaling systems that request a just-in-time configuration for every job, which can write this action many times an hour. Exclude the service account or GitHub App your provisioning uses by actor, and alert on every other caller.
level: medium
False positives
- Autoscaling systems that request a just-in-time configuration for every job, which can write this action many times an hour. Exclude the service account or GitHub App your provisioning uses by actor, and alert on every other caller.
GitHub Self-Hosted Runner Group Changed
Detects a self-hosted runner group being reconfigured, its repository access being changed, or runners being added to it. These changes decide which repositories send jobs to which machines, and whether public repositories may use the group.
title: GitHub Self-Hosted Runner Group Changed
id: c01b7902-060b-4f6c-9d32-dffbcf3e677a
status: experimental
description: >-
Detects a self-hosted runner group being reconfigured, its repository
access being changed, or runners being added to it. These changes decide
which repositories send jobs to which machines, and whether public
repositories may use the group.
references:
- https://attack.mitre.org/techniques/T1677/
- https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
- https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/manage-access
author: Forestall
date: 2026-11-11
tags:
- attack.execution
- attack.t1677
logsource:
product: github
service: audit
detection:
selection:
action:
- org.runner_group_updated
- org.runner_group_visiblity_updated
- org.runner_group_runners_added
- org.runner_group_runners_updated
- enterprise.runner_group_updated
- enterprise.runner_group_visiblity_updated
- enterprise.runner_group_runners_added
- enterprise.runner_group_runners_updated
condition: selection
falsepositives:
- Routine runner maintenance by the platform team. Review the runner_group_allow_public field and the repositories given access, and exclude the provisioning account by actor if the volume is high.
level: low
False positives
- Routine runner maintenance by the platform team. Review the runner_group_allow_public field and the repositories given access, and exclude the provisioning account by actor if the volume is high.
GitHub Self-Hosted Runner Registered
Detects a new self-hosted GitHub Actions runner being registered for a repository, an organization or an enterprise. Jobs routed to the runner expose their secrets and tokens to whoever controls the machine.
title: GitHub Self-Hosted Runner Registered
id: 5854e065-b44c-44fe-8355-f7fa241c8f6b
status: experimental
description: >-
Detects a new self-hosted GitHub Actions runner being registered for a
repository, an organization or an enterprise. Jobs routed to the runner
expose their secrets and tokens to whoever controls the machine.
references:
- https://attack.mitre.org/techniques/T1677/
- https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
- https://docs.github.com/en/actions/reference/security/secure-use
author: Forestall
date: 2026-11-11
tags:
- attack.execution
- attack.t1677
logsource:
product: github
service: audit
detection:
selection:
action:
- repo.register_self_hosted_runner
- org.register_self_hosted_runner
- enterprise.register_self_hosted_runner
condition: selection
falsepositives:
- Platform teams adding runners, and autoscaling systems that register a runner for each job. Exclude the service account or GitHub App your provisioning uses by actor, and alert on every other registration.
level: medium
False positives
- Platform teams adding runners, and autoscaling systems that register a runner for each job. Exclude the service account or GitHub App your provisioning uses by actor, and alert on every other registration.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
New self-hosted runner that receives jobs with secrets soon after it appears
The registration event shows that a runner was added but not which machine it is or what it went on to run. A runner that comes online right after a registration by an account outside your provisioning, and then starts jobs that were given secrets, is the pattern of a rogue runner that is collecting them.
- A runner is added by an account that is not your provisioning identity:
register_self_hosted_runnerorconfigure_self_hosted_jit_runneratrepo.,org.orenterprise.level, with the account inactor. - Shortly after, a runner comes online in the same organization or repository:
org.self_hosted_runner_onlineorenterprise.self_hosted_runner_online, which carryrunner_idandrunner_name. Check both against your inventory of runners. - Collect the
workflows.prepared_workflow_jobevents with thatrunner_id. The fieldsecrets_passedlists the secrets each job was given, andjob_name,job_workflow_refandrepoidentify the job.
Eventsrepo.register_self_hosted_runnerorg.register_self_hosted_runnerorg.configure_self_hosted_jit_runnerorg.self_hosted_runner_onlineworkflows.prepared_workflow_job
LimitsThe documented fields of the registration actions do not name the runner, so the first two steps are tied by time and place only, which is weak where runners are added all day. The online event and the job event are not shown in the web interface and need the REST API, audit log streaming or an export. Autoscaling has to be excluded by its account.
Triage
- Identify who registered the runner (actor) and where (org, repo), and whether the token used was a personal access token (programmatic_access_type, token_scopes).
- Find the runner's name and labels in the organization or repository settings, and confirm the machine with the team that owns your runners.
- Review workflow files added or changed around the same time, especially workflows triggered by discussions, issues or comments that target self-hosted runners.
- If unexpected, remove the runner, rotate every secret available to the jobs it ran, and review the actor's other activity.
Response
Once the attack is confirmed:
- Remove the runner from the repository, organization or enterprise so that no further job is routed to it, and take it out of any runner group it was added to.
- If the registered machine is one of your own, such as a developer laptop or a build server, isolate it and treat it as compromised. In that case the runner is a remote command channel into your network.
- Remove or revert the workflow files that target the runner, especially ones triggered by discussions, issues or comments, and cancel their queued runs.
- List the jobs the runner executed and rotate everything those jobs could read, which is the secrets available to them and any cloud credentials they obtained.
- Revoke the credential that registered the runner. If it was a personal access token, revoke the token and secure the account that owns it.
- Check the remaining runners and runner groups against your provisioning records.
Mitigation
- Limit which repositories may create repository-level self-hosted runners, and keep runner management permissions to a small platform team.
- Put organization runners in runner groups restricted to selected repositories, and do not allow public repositories to use them.
- Prefer ephemeral, just-in-time runners created by your own automation, so any other registration stands out.
- Alert on runner registrations and runner group changes outside your provisioning process.
Frequently asked questions
Why is a runner registered on one of our own machines a problem?
A runner executes what a workflow tells it to. If malware registers an infected machine as a self-hosted runner and adds a workflow, the attackers can run commands on that machine through ordinary GitHub events. In an npm supply chain campaign of November 2025, Unit 42 reported this pattern, with commands delivered by opening GitHub discussions.
Which jobs could a rogue runner have received?
A job goes to a runner that matches the labels and the runner group it asks for. A repository-level runner serves that repository, while an organization runner can serve jobs from many repositories. Check the runner's labels and group, and the workflows that ask for them, to list the jobs it ran.
Our autoscaling registers a runner for every job. How do I keep the rule useful?
Exclude the service account or GitHub App that your provisioning uses by `actor`, and alert on every other registration. Ephemeral, just-in-time runners created by your own automation make a registration from any other actor stand out. A registration by a person, or through a personal access token, deserves a look.
What can whoever controls a self-hosted runner see?
GitHub warns that whoever controls the runner environment can reach the secrets of the jobs it runs and their `GITHUB_TOKEN`. Unlike GitHub-hosted runners, self-hosted runners are not clean, isolated machines. The secrets, tokens and source code of every job routed to the runner are therefore exposed to the person who operates it.
References
- MITRE ATT&CK T1677: Poisoned Pipeline Execution
- Secure use reference for GitHub Actions (hardening for self-hosted runners)
- Adding self-hosted runners
- Managing access to self-hosted runners using groups
- Audit log events for your organization
- Unit 42: Shai-Hulud worm compromises npm ecosystem in supply chain attack