TL;DR: GitHub Actions workflows triggered by pull_request_target can expose write access and secrets to untrusted input, creating a direct path to command injection, credential theft, and downstream supply chain compromise, according to Sonar’s analysis. The real governance problem is not just unsafe syntax, but assuming CI/CD automation can be trusted before input handling and permission scope are verified.
Editorial analysis by NHI Mgmt Group, based on content published by Sonar: “Securing GitHub Actions With SonarQube: Real-World Examples”.
Key questions
Q: What breaks when pull_request_target workflows process untrusted input?
A: The workflow can turn attacker-controlled text or branch names into executable shell syntax while still running with the base repository's permissions.
Q: Why do CI/CD workflows with standing write permissions increase supply chain risk?
A: Standing write permissions widen the blast radius of a workflow compromise.
Q: What are the signs that a GitHub Actions workflow is misconfigured for public repository security?
A: Common warning signs include workflows that run automatically on forked pull requests, use pull_request_target while checking out untrusted code, echo untrusted input inside inline scripts, or rely on elevated GITHUB_TOKEN permissions.
Practitioner guidance
- Audit pull_request_target usage Inventory every workflow triggered by pull_request_target and classify whether it truly needs base-branch privileges, secrets, or write access.
- Eliminate unsafe context interpolation Replace direct ${{ github.event.* }} insertion into run steps with shell-safe variable handling, quoting, and explicit sanitisation for any user-controlled field.
- Restrict token permissions by default Set GITHUB_TOKEN to the minimum permissions required for each job, and remove write scope from workflows that only need read access.
Bottom line: GitHub Actions becomes materially risky when privileged workflows process untrusted input without strong boundary controls.
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
CI/CD trust boundary drift is the real governance issue: the problem is not simply malformed YAML, but automation running with privileges that no longer match the trust level of the input. pull_request_target is a governance boundary that many teams treat as a convenience flag, and that is where the control failure begins. Practitioners need to separate untrusted contribution handling from privileged release automation.
A question worth separating out:
Q: How should teams respond when they find suspicious GitHub Actions activity?
A: Contain the workflow first by freezing the affected branch, revoking exposed tokens, and reviewing recent job executions for encoded commands or unusual outbound connections. Then trace where the credentials could have been used, because the true risk is not just the modified workflow but the access it may have unlocked.
👉 Read our full editorial: GitHub Actions command injection exposes supply chain credentials