1. Resources
  2. Detection rules
  3. Actions Token or Fork Pull Request Policy Weakened in GitHub

Actions Token or Fork Pull Request Policy Weakened in GitHub detection rules

An attacker with admin access changes the GitHub Actions settings that decide what a workflow may do, so a workflow run gets a write token, may approve pull requests, or runs code from a fork with secrets.

Platform
GitHub
Severity
Medium
Log source
GitHub audit log
Last updated
MITRE ATT&CK technique
T1677Poisoned Pipeline Execution
Tactic
Execution
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Admin access to a repository, or control of an organization owner, an Actions policy manager or an enterprise owner account for the wider scopes.
Impact
Workflow runs get a write token, may approve pull requests, or run code from fork pull requests with write tokens or secrets.
Response
Set the changed setting back at the level where it was changed, and review the workflow runs that started while it was loose.
Mitigation
Set the restricted token default and the fork pull request policies at organization or enterprise level, so that a repository cannot loosen them.
Audit actions
repo.update_actions_settingsorg.update_actions_settingsbusiness.update_actions_settingsrepo.update_actions_access_settingsrepo.set_fork_pr_workflows_policyorg.set_fork_pr_workflows_policybusiness.set_fork_pr_workflows_policyrepo.set_actions_fork_pr_approvals_policyorg.set_actions_fork_pr_approvals_policybusiness.set_actions_fork_pr_approvals_policyrepo.set_actions_private_fork_pr_approvals_policyorg.set_actions_private_fork_pr_approvals_policyand 7 more in the rules below
Threat groups
APT38TeamPCP

How the attack works

GitHub Actions has a small group of settings that decide how much a workflow run is trusted. The default permissions of the GITHUB_TOKEN are either restricted (read access to contents and packages) or permissive (read and write access for all permissions). A second setting decides whether workflows may create and approve pull requests. For pull requests from forks, the settings decide whether workflows run at all, whether they receive a token with write permission, whether all secrets are made available to them, and which contributors need an approval from someone with write access before their workflows run. Each setting exists for a repository, an organization and an enterprise.

An attacker who controls an account with admin access does not need to touch a workflow file to gain from these settings. With a permissive token, any workflow in the repository, including one that a contributor's change reaches, can push code and change releases. With pull request approval allowed, a workflow can approve a change that the attacker's own account proposed. With write tokens or secrets sent to fork pull requests, code from an outside fork runs with the repository's credentials. GitHub records every change as its own audit log action, for example repo.set_default_workflow_permissions or org.set_fork_pr_workflows_policy. The same actions are written when a setting is tightened, so the events need the value they carry and the context around them.

What an attacker needs

  • Admin access to a repository for the repository settings.
  • An organization owner, or a user with the "Manage organization Actions policies" permission, for the organization settings.
  • An enterprise owner for the enterprise policies.
  • No stricter policy at a higher level. GitHub states that a fork policy that is disabled for an enterprise or organization cannot be enabled for a repository, and that a restrictive token default chosen for the organization disables the permissive option in its repositories.

Impact

Workflow runs in the affected repositories receive more than they should. A permissive GITHUB_TOKEN lets any workflow write to the repository. A workflow that may approve pull requests weakens a required review. Write tokens or secrets sent to workflows from fork pull requests hand the repository's credentials to code written outside the organization. At organization or enterprise level one change applies to every repository that inherits the setting, and it stays in effect until someone reviews the Actions settings.

Detection rules

GitHub Actions Allowed Actions Policy or Workflow Access Setting Changed

Detects a change of the GitHub Actions policy settings of a repository, an organization or an enterprise (update_actions_settings), which include the policy for which actions and reusable workflows may run, and a change of the setting that lets workflows in other repositories use the actions and reusable workflows of a private or internal repository (repo.update_actions_access_settings). A wider policy lets workflows call actions from any publisher, and a wider access setting exposes a repository's workflows to more repositories. The rule matches on the action only and is meant as context. The events carry old_policy and new_policy or policy, whose values GitHub does not describe.

LevelLowStatusExperimentalLog sourceGitHub audit log
title: GitHub Actions Allowed Actions Policy or Workflow Access Setting Changed
id: a833932a-cc48-46ff-96f8-9ef0bdf4e82d
status: experimental
description: >-
  Detects a change of the GitHub Actions policy settings of a repository, an
  organization or an enterprise (update_actions_settings), which include the
  policy for which actions and reusable workflows may run, and a change of
  the setting that lets workflows in other repositories use the actions and
  reusable workflows of a private or internal repository
  (repo.update_actions_access_settings). A wider policy lets workflows call
  actions from any publisher, and a wider access setting exposes a
  repository's workflows to more repositories. The rule matches on the
  action only and is meant as context. The events carry old_policy and
  new_policy or policy, whose values GitHub does not describe.
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/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository
  - 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.update_actions_settings
      - org.update_actions_settings
      - business.update_actions_settings
      - repo.update_actions_access_settings
  condition: selection
falsepositives:
  - Administrators who add an action to the allowed list or share a repository of reusable workflows, which is routine platform work. Use the rule as context for other alerts on the same repository or organization.
level: low

False positives

  • Administrators who add an action to the allowed list or share a repository of reusable workflows, which is routine platform work. Use the rule as context for other alerts on the same repository or organization.

GitHub Actions Fork Pull Request Workflow Policy Changed

Detects a change of the policies for workflows on pull requests from forks, for a repository, an organization or an enterprise. The action set_fork_pr_workflows_policy covers the policy for forks of private repositories, which decides whether such workflows run and whether they receive write tokens and secrets. The actions set_actions_fork_pr_approvals_policy and set_actions_private_fork_pr_approvals_policy cover which contributors need an approval before their workflows run. The rule matches on the action only. GitHub lists a policy field for these actions without describing its values, and the same action is written when the policy is tightened.

LevelMediumStatusExperimentalLog sourceGitHub audit log
title: GitHub Actions Fork Pull Request Workflow Policy Changed
id: 6efbc743-0229-4547-8a1a-ce7859b92cce
status: experimental
description: >-
  Detects a change of the policies for workflows on pull requests from
  forks, for a repository, an organization or an enterprise. The action
  set_fork_pr_workflows_policy covers the policy for forks of private
  repositories, which decides whether such workflows run and whether they
  receive write tokens and secrets. The actions
  set_actions_fork_pr_approvals_policy and
  set_actions_private_fork_pr_approvals_policy cover which contributors need
  an approval before their workflows run. The rule matches on the action
  only. GitHub lists a policy field for these actions without describing its
  values, and the same action is written when the policy is tightened.
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/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository
  - 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.set_fork_pr_workflows_policy
      - org.set_fork_pr_workflows_policy
      - business.set_fork_pr_workflows_policy
      - repo.set_actions_fork_pr_approvals_policy
      - org.set_actions_fork_pr_approvals_policy
      - business.set_actions_fork_pr_approvals_policy
      - repo.set_actions_private_fork_pr_approvals_policy
      - org.set_actions_private_fork_pr_approvals_policy
      - business.set_actions_private_fork_pr_approvals_policy
  condition: selection
falsepositives:
  - Administrators who tighten the policy or set it for a new repository. Confirm the direction from the policy field of the event and from the settings page.
  - Open source maintainers who adjust the approval requirement for outside contributors. Confirm the change with the repository owner.
level: medium

False positives

  • Administrators who tighten the policy or set it for a new repository. Confirm the direction from the policy field of the event and from the settings page.
  • Open source maintainers who adjust the approval requirement for outside contributors. Confirm the change with the repository owner.

GitHub Actions Workflow Token Permissions or Pull Request Approval Setting Changed

Detects a change of the default permissions that the GITHUB_TOKEN gets in workflow runs (set_default_workflow_permissions) and of the setting that lets GitHub Actions create and approve pull requests (set_workflow_permission_can_approve_pr), for a repository, an organization or an enterprise. The permissive token default gives every workflow without its own permissions block read and write access, and pull request approval by workflows weakens a required review. The rule matches on the action only, because GitHub writes the same action when the setting is tightened and does not describe the values of the fields default_workflow_permissions_value and workflow_permission_can_approve_pr_value. Read those fields in triage.

LevelMediumStatusExperimentalLog sourceGitHub audit log
title: GitHub Actions Workflow Token Permissions or Pull Request Approval Setting Changed
id: 13b852df-50a6-4bef-8428-3ced7f2a08d7
status: experimental
description: >-
  Detects a change of the default permissions that the GITHUB_TOKEN gets in
  workflow runs (set_default_workflow_permissions) and of the setting that
  lets GitHub Actions create and approve pull requests
  (set_workflow_permission_can_approve_pr), for a repository, an
  organization or an enterprise. The permissive token default gives every
  workflow without its own permissions block read and write access, and
  pull request approval by workflows weakens a required review. The rule
  matches on the action only, because GitHub writes the same action when the
  setting is tightened and does not describe the values of the fields
  default_workflow_permissions_value and
  workflow_permission_can_approve_pr_value. Read those fields in triage.
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/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository
  - 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.set_default_workflow_permissions
      - org.set_default_workflow_permissions
      - business.set_default_workflow_permissions
      - repo.set_workflow_permission_can_approve_pr
      - org.set_workflow_permission_can_approve_pr
      - business.set_workflow_permission_can_approve_pr
  condition: selection
falsepositives:
  - Administrators who tighten the setting, which writes the same action. Confirm the direction from the value field of the event and from the settings page.
  - Infrastructure-as-code tools that set repository settings on every run. Exclude the service identity they use by actor.
level: medium

False positives

  • Administrators who tighten the setting, which writes the same action. Confirm the direction from the value field of the event and from the settings page.
  • Infrastructure-as-code tools that set repository settings on every run. Exclude the service identity they use by actor.

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.

Repository token default changed to a value other than the organization's

Detection hypothesisCompares with an earlier value

An organization that has chosen a default for the workflow token expects its repositories to carry the same value. A repository whose value differs from the last value set for the organization was changed on purpose, and when the organization's value is the restricted one the difference is a loosening.

  1. Keep the latest value the organization set: org.set_default_workflow_permissions, field default_workflow_permissions_value.
  2. A repository changes its own default: repo.set_default_workflow_permissions. Take repo, actor and default_workflow_permissions_value.
  3. Alert when the repository value differs from the stored organization value, and do the same for workflow_permission_can_approve_pr_value of the set_workflow_permission_can_approve_pr actions.

Eventsorg.set_default_workflow_permissionsrepo.set_default_workflow_permissionsorg.set_workflow_permission_can_approve_prrepo.set_workflow_permission_can_approve_pr

LimitsGitHub lists the value fields without describing their values, so read them on your own events first. Where the organization default is restricted GitHub disables the permissive option in repositories, so a match then usually means the organization value was changed earlier. Repositories with an agreed exception have to be listed and excluded.

Fork pull request policy changed and a pull request workflow run soon after

Detection hypothesisSequence of eventsJoins two logs

An attacker who opens the fork policy wants a pull request workflow to run before anyone reverts the change. A policy change that is followed within hours by a workflow run triggered by a pull request in the same repository links the setting to its use.

  1. A fork policy changes: repo.set_fork_pr_workflows_policy, repo.set_actions_fork_pr_approvals_policy or repo.set_actions_private_fork_pr_approvals_policy, or the org. action of the same name. Keep repo or org, actor, policy and the time.
  2. Within 24 hours a run starts in the same repository or organization: workflows.created_workflow_run. The field event holds what triggered the run and head_branch the branch.
  3. Alert when the trigger in event is a pull request event, and attach the policy change to the alert.

Eventsrepo.set_fork_pr_workflows_policyrepo.set_actions_fork_pr_approvals_policyworkflows.created_workflow_run

LimitsPull request workflows run all day in an active repository, so the second step alone means nothing. GitHub delivers workflows.created_workflow_run through the REST API, audit log streaming and exports only. The 24 hours are a starting point.

Triage

  • Identify who made the change (actor) and the level from the action prefix, which is repo., org. or business.. For a repository change read repo.
  • Read the new value. The token actions carry default_workflow_permissions_value, the pull request approval actions workflow_permission_can_approve_pr_value and the fork actions policy. Compare it with the setting shown under Actions, General in the settings of the repository or organization.
  • Decide whether the change loosens or tightens. A permissive token default, approval of pull requests by workflows, write tokens or secrets for fork pull requests and a weaker approval requirement are the loosening changes.
  • Check whether a token made the change (programmatic_access_type, hashed_token) and whether the same account changed workflow files, branch protection or secrets in the same period.
  • List the workflow runs of the affected repositories since the change, and look for runs that were triggered by pull requests from forks.

Response

Once the attack is confirmed:

  1. Set the changed setting back to its previous value at the level where it was changed, and enforce it from the organization or enterprise so that a repository cannot loosen it again.
  2. Review the workflow runs that started while the setting was loose, with the pushes, releases and pull request approvals they made, and revert what was not intended.
  3. Rotate the secrets that workflows from fork pull requests could read while secrets were sent to them.
  4. Secure the account that made the change. Revoke the token it used, or reset the credentials and end the sessions of a person's account.
  5. Review the other Actions settings, the branch protection and the environment protection rules of the same repositories for changes by the same actor.

Mitigation

  • Set the restricted GITHUB_TOKEN default for the organization or the enterprise. GitHub then selects the same option in the repositories and disables the permissive one.
  • Keep "Allow GitHub Actions to create and approve pull requests" off at organization level unless a named workflow needs it.
  • Leave "Send write tokens to workflows from pull requests" and "Send secrets to workflows from pull requests" off for private and internal repositories, and require approval for fork pull request workflows.
  • For public repositories, require approval for all external contributors. GitHub warns that the two first-time contributor options stop applying once any commit of the user has been merged.
  • Keep repository admin access and the organization permission to manage Actions policies to the people who need them, and alert on every change of these settings.

Frequently asked questions

Does the audit event show whether the setting was loosened or tightened?

The action name does not. The same action is written for both directions. GitHub lists a value field for these actions, `default_workflow_permissions_value`, `workflow_permission_can_approve_pr_value` or `policy`, but its event reference does not describe the values. Read the field on your own events and compare it with the setting in the user interface before you build a filter on it.

Why does a write token for the workflow matter when the workflow file is unchanged?

The default applies to every workflow that does not set its own permissions. GitHub states that anyone with write access to a repository can change the permissions of the token by editing the `permissions` key in the workflow file, but a restricted default at organization level limits what a repository can choose. A permissive default gives every such workflow, and every action it calls, write access to the repository.

Do workflows from forks get secrets by default?

No. GitHub states that workflows from forks do not have access to secrets, and for private repositories the option "Run workflows from fork pull requests" uses a read-only token and no secrets. Secrets and write tokens reach fork pull requests only when the two separate options are switched on, which is why a change of the fork policy deserves attention.

Is there an incident report that shows this step in an audit log?

No public incident report describes this change at the audit event level. The page is built on what GitHub documents the settings to do. Reports about pipeline attacks describe untrusted code that ran with a privileged token or with secrets, and these settings are what allows or prevents that.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.