TL;DR: A single pull request from a fork can turn GitHub Actions workflows into code execution, token theft, secret exposure, and repository compromise across Microsoft, Google, Nvidia, and others, according to Orca Security. The problem is not the fork itself but the assumption that untrusted pull request code can safely enter privileged workflows.
At a glance
What this is: This is a security analysis of GitHub Actions pull request abuse, showing how misconfigured workflows can let forked contributions execute privileged code and reach tokens, secrets, and repository write paths.
Why it matters: It matters because CI/CD identity boundaries, not just application code, now determine whether attackers can move from untrusted contribution to privileged execution across NHI, autonomous, and human governance programmes.
By the numbers:
- Systems with least-privileged AI access had a 17% incident rate vs 76% for over-privileged systems.
👉 Read Orca Security's analysis of GitHub Actions pwn request exploitation
Context
GitHub Actions becomes dangerous when untrusted pull request code is allowed to run in a privileged context. The underlying issue is an identity and trust boundary problem: repository automation, runner permissions, and secrets access are being treated as if contributor code were already trusted.
In practice, that means a forked contribution can inherit execution rights that were meant for maintainers or internal workflows. For IAM, NHI, and platform teams, the real question is not whether GitHub can automate the pipeline, but whether the workflow identity is scoped tightly enough to survive hostile input.
Key questions
Q: How should security teams stop forked pull requests from reaching privileged GitHub Actions jobs?
A: Security teams should separate validation from privilege. Forked pull requests should run in workflows with no write permissions, no deployment secrets, and no path to protected environments. Trust should be assigned only after branch origin, event type, and job scope are verified, because the dangerous step is untrusted code executing inside a privileged runner.
Q: Why do GitHub Actions misconfigurations create so much lateral movement risk?
A: They create lateral movement risk because a workflow runner can inherit access to repository writes, tokens, secret stores, and sometimes cloud credentials. Once attacker-controlled code executes in that context, the compromise is no longer limited to source control. The workflow becomes a bridge into packaging, deployment, and infrastructure control.
Q: What do security teams get wrong about pull_request_target workflows?
A: Teams often assume the trigger is safe if the workflow looks familiar or uses reusable components. The problem is not the trigger name, it is whether the job executes untrusted code before the workflow has confirmed that the contributor is allowed to influence privileged actions. Familiar automation can still be an execution path for attackers.
Q: Who is accountable when a GitHub Actions workflow exposes secrets or pushes malicious code?
A: Accountability sits with the team that defined the workflow trust boundary and granted the permissions, not with the runner or the contributor alone. Frameworks such as NIST Cybersecurity Framework 2.0 expect governance over access, change control, and response. If a workflow can write, publish, or deploy, it needs explicit ownership and review.
Technical breakdown
Why pull_request_target changes the trust boundary
The pull_request_target trigger runs workflow code in the context of the base repository, not the fork. That matters because the workflow can receive elevated permissions, access secrets, and write back to the repository while still processing content supplied by an external contributor. If the job checks out attacker-controlled code before validation, the workflow turns untrusted input into executable content with maintainers’ privileges. This is why the attack is not just a CI misconfiguration. It is an identity boundary failure between contributor intent and workflow authority.
Practical implication: Treat forked pull requests as hostile input and block privileged execution until code, branch origin, and job scope are explicitly validated.
How GitHub Actions permissions become an NHI issue
GitHub Actions jobs often run with ephemeral runner identities and a GITHUB_TOKEN that can be configured for read or write access. That token is a non-human identity credential, even when the workflow looks temporary. If the workflow requests contents: write or pull-requests: write, the runner can create branches, modify repositories, or expose downstream secrets. The problem compounds when reusable workflows inherit permissions that were never meant for external contributions. In NHI terms, this is standing privilege dressed up as automation.
Practical implication: Review every workflow token and permission block as an NHI entitlement, then remove write access from jobs that process untrusted contributions.
Why secrets exposure and lateral movement follow quickly
Once code runs inside a privileged workflow, the attacker is no longer limited to repository content. They can often reach API keys, deployment credentials, cloud service principals, or other internal tokens embedded in the pipeline. From there, the path extends into package publishing, branch manipulation, cloud actions, and lateral movement into adjacent systems. The architecture problem is that CI/CD identities are often trusted to bridge development and infrastructure. When that bridge is open to external code, the workflow becomes a pivot point rather than a guardrail.
Practical implication: Separate build, validation, and deployment identities so a compromised PR workflow cannot reach the credentials used for release or cloud access.
Threat narrative
Attacker objective: Convert a trusted repository automation path into a foothold for code modification, secret theft, and downstream compromise.
- Entry occurs when an attacker submits a forked pull request to a workflow using pull_request_target and untrusted code is checked out in a privileged job.
- Credential access follows when the workflow runner inherits a writable GITHUB_TOKEN or secrets exposure path, allowing branch creation, token theft, or secret exfiltration.
- Impact comes from repository tampering, package poisoning, deployment abuse, and possible lateral movement into cloud or adjacent infrastructure.
- The broader objective is to turn routine pull request handling into a privileged execution path that yields code, secrets, and downstream infrastructure control.
Breaches seen in the wild
- Emerald Whale breach — exposed Git config files led to 15K secrets stolen and 10K repo compromises.
- Shai Hulud npm malware campaign — Shai Hulud campaign: npm malware exposed secrets on GitHub.
Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Fork trust is not a safe default when the workflow identity can write back to the repository. GitHub Actions treats pull request automation as a software execution problem, but the security failure is identity scoping. Once untrusted contributor code is checked out inside a privileged job, the workflow identity has crossed from review into execution authority. Practitioners should treat that boundary as an NHI control point, not a developer convenience.
The core failure mode is privileged automation with external input, not GitHub Actions itself. The same pull request machinery that enables collaboration becomes an attack surface when contents: write, secrets access, or reusable workflow inheritance survives the fork boundary. This is a classic least-privilege problem, but in CI/CD the identity is ephemeral, the damage is immediate, and the trust decision happens before the human can intervene. Security teams need to reframe workflow design around execution authority, not trigger convenience.
Repository automation now behaves like a cross-domain identity bridge. The runner identity can move from code review to package publishing, deployment, cloud access, and token exposure in one job. That collapses the old assumption that CI/CD is only a build concern. The implication is that GitHub workflow governance belongs beside NHI and PAM governance, because the same entitlement mistakes can propagate into infrastructure control.
Identity blast radius is the right concept for these failures. A single workflow misconfiguration can extend a forked contribution from source control into secrets, deployments, and cloud tenants. That is not merely a vulnerable repository, it is a wide blast radius created by over-trusting a non-human execution path. Practitioners should think in terms of how far one privileged job can reach when contributor code is admitted without containment.
Access review alone cannot compensate for workflow design that grants write power to untrusted code. Reviews happen after the fact, but the compromise occurs at execution time. The practical takeaway is to govern GitHub Actions as an identity system with defined trust tiers, not as a neutral automation layer. Teams that ignore that distinction will keep rediscovering the same failure in different repositories.
From our research:
- Systems with least-privileged AI access had a 17% incident rate vs 76% for over-privileged systems, according to The 2026 Infrastructure Identity Survey.
- From our research: Only 44% of organisations have implemented any policies to manage their AI agents, despite 92% agreeing that governing AI agents is critical to enterprise security, according to The 2026 Infrastructure Identity Survey.
- For practitioners: Read Ultimate Guide to NHIs - Lifecycle Processes for Managing NHIs for the lifecycle controls that define, constrain, and retire non-human access.
What this signals
With 67% of organisations still relying heavily on static credentials despite the risks they pose to agentic AI deployments, the pattern behind GitHub Actions abuse is broader than one workflow family. The governance gap is not isolated to code review. It sits in the way organisations let ephemeral execution paths inherit durable trust, which is exactly why workflow identities need lifecycle thinking and stricter boundaries.
Execution-path trust debt: when untrusted input is allowed to inherit privileged automation, the organisation accumulates a hidden entitlement exposure that shows up only after compromise. That means platform teams must track workflow permissions, runner scope, and secret adjacency with the same seriousness they apply to service accounts and cloud access.
For teams using NIST Cybersecurity Framework 2.0 and related access controls, the practical signal is simple: if a workflow can write, deploy, or expose secrets without a separate trust decision, the control design is already too permissive. The next step is to make the pipeline identity observable, reviewable, and revocable before contributors can influence it.
For practitioners
- Split untrusted and privileged jobs Run forked pull request validation in a non-privileged workflow with no write permissions, no release credentials, and no deployment environment access.
- Remove checkout before trust checks Validate branch origin, event type, and repository source before any checkout of contributor-controlled code occurs in a job with elevated permissions.
- Treat workflow tokens as NHI credentials Inventory GITHUB_TOKEN usage, reusable workflow permissions, and environment secrets as non-human identities with explicit scope and expiration.
- Gate privileged actions behind protected environments Use required reviewers and environment protections for any job that can publish artifacts, modify branches, or touch cloud credentials.
- Monitor for repository-to-cloud pivots Correlate Actions runner activity with cloud service principal use, package publication, and secret access so a workflow compromise is detected before lateral movement completes.
Key takeaways
- GitHub Actions fork handling becomes a breach path when untrusted code is checked out inside a privileged workflow.
- The impact is not limited to source code because workflow tokens and secrets can extend compromise into deployments, packages, and cloud access.
- The control that matters most is separating validation from privilege so untrusted pull requests never inherit write or secret-bearing identity.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | Privilege sprawl in runners and tokens maps directly to NHI lifecycle and rotation controls. |
| NIST CSF 2.0 | PR.AC-4 | Workflow permissions and secret access are access-control issues in a pipeline identity context. |
| NIST Zero Trust (SP 800-207) | AC-4 | This attack abuses a trust boundary that zero trust should not assume is safe by default. |
Enforce explicit trust checks before any workflow can cross from contributor input to privileged execution.
Key terms
- Pull Request Trust Boundary: The point at which untrusted contributor input crosses into a workflow or system that can execute privileged actions. In GitHub Actions, this boundary determines whether forked code can influence secrets, deployment steps, or repository writes. Treating it as explicit identity scope is essential to preventing abuse.
- Workflow Identity: The non-human identity under which a CI/CD job runs, including its token, permissions, runner context, and access to secrets. Workflow identity should be treated like any other machine identity, with least privilege, short scope, and clear ownership. If it can write or deploy, it is a governance object, not just automation.
- Identity Blast Radius: The amount of downstream access and operational impact a compromised identity can reach before containment. For CI/CD pipelines, blast radius includes repository writes, package publication, secret exposure, and cloud control. The larger the blast radius, the more likely a single workflow flaw becomes a multi-system incident.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or IAM programme maturity, it is worth exploring.
This post draws on content published by Orca Security: GitHub Actions pwn requests and privileged workflow exploitation. Read the original.
Published by the NHIMG editorial team on 2025-09-30.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org