When publishing workflows rely on broad credentials and weak secret handling, teams risk exposing keys, abusing long-lived access, and letting compromised automation reach production-facing systems. The safer pattern is to replace static secrets where possible, reduce standing privilege, and add controls that detect leakage before code or artifacts are released. That narrows the attack surface and makes compromise harder to turn into downstream impact.
What fails when publishing jobs run with broad standing access
GitHub Actions publishing is safest when the workflow can prove who it is, request only the access it needs, and expire that access quickly. Without modern identity controls, the workflow often depends on long-lived secrets, shared credentials, or overbroad tokens that can be reused outside the pipeline. That turns a build step into a durable access path.
Static credentials create two compounding problems. First, they are easy to leak through logs, artifacts, forked pull requests, or misconfigured repository settings. Second, once exposed, they often remain useful far beyond the job that used them. NHIMG’s Guide to the Secret Sprawl Challenge is a useful companion here because it shows how CI/CD secret exposure becomes an operational problem, not just a configuration issue.
Modern controls reduce that exposure by replacing reusable secrets with short-lived, workload-bound credentials and by narrowing what the workflow can do at publish time. That matters because publishing is usually the last step before code, packages, or artifacts become externally consumable. If the workflow can mint or reuse powerful access, compromise of the pipeline can become compromise of the release path.
One useful way to think about this is blast radius. A compromised workflow with broad write access is not just a build problem, it can become a repository tampering problem, a package integrity problem, or a production access problem depending on what the token can reach. CI/CD pipeline exploitation case study illustrates how exposed pipeline secrets and mismanaged paths can escalate into deeper system compromise.
When teams still rely on secrets in GitHub Actions, leakage is only half the issue. Rotation, scoping, and revocation usually lag behind the release process, so the organization may continue to trust a credential long after it should have expired. That gap is especially dangerous in automated publishing because the job is expected to be repeatable and unattended, which makes weak secret handling easy to overlook until abuse appears.
NHIMG’s Ultimate Guide to NHIs is relevant because it frames the broader control problem: non-human access should be discoverable, governed, and rotated, not left as a static exception embedded in delivery tooling. The same logic applies whether the identity is a service account, a token, or a CI job credential.
Why secret leakage becomes a release and supply-chain problem
Publishing workflows sit at the point where source control, build systems, and distribution systems meet. If secrets are exposed there, an attacker does not need to compromise production directly. They may only need to steal the publishing token, impersonate the workflow, and push malicious artifacts, tags, or package updates that downstream consumers will trust.
That is why weak secret protection is more than “credential hygiene.” It creates a trust problem for everything the pipeline emits. A stolen publishing secret can produce malicious releases that look legitimate, especially when the workflow has permission to sign, publish, or update metadata. In practice, that means the compromise can travel outward from one repository into dependency consumers and deployment systems.
GitHub-specific incidents are useful because they show how supply-chain abuse often starts with access that looked routine. NHIMG’s GitHub Action tj-actions Supply Chain Attack demonstrates how action compromise can leak large volumes of CI/CD secrets, while the Reviewdog GitHub Action supply chain attack shows how a trusted workflow component can become the exfiltration path.
There is also a lifecycle issue. Secrets embedded in publishing automation are often copied across repositories, environments, and teams, which makes revocation hard and ownership unclear. Once that happens, the organization may not know which workflows still depend on the credential, which systems can use it, or whether the secret has already been exposed in logs or history. That uncertainty is what turns a single leak into a recurring operational risk.
One current data point that captures the scale of the problem is NHIMG’s finding that 96% of organisations store secrets outside of secrets managers in vulnerable locations including code, config files, and CI/CD tools. In a publishing context, that means the failure mode is common enough that teams should assume the workflow boundary is already a likely exposure point, not a theoretical one.
Risk and Threat Considerations
Publishing from GitHub Actions without modern identity controls creates an attractive attack path because a single leaked secret can authorize code release, package publishing, or privileged downstream access. The main risk is not just unauthorized login, but trusted automation being repurposed to ship malicious or tampered output.
Failure mechanism: Broad or long-lived secrets are exposed through workflow logs, repository contents, third-party actions, or compromised runners, then reused to impersonate the publishing job or extend access beyond its intended scope.
Impact: Attackers can publish rogue artifacts, modify release channels, reach production-facing systems, or persist through credentials that remain valid after the original leak is discovered.
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 and MITRE ATT&CK address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 — Secrets and Credential Management | Publishing workflows rely on secrets that must be short-lived and tightly scoped. |
| NHI-02 — Identity Lifecycle and Offboarding | Leaked workflow credentials need rapid revocation and ownership clarity. | |
| NHI-03 — Privilege and Access Minimization | Workflow tokens that can publish or reach production are a privilege-risk issue. | |
| Recommendation — Replace static publishing secrets with short-lived, tightly scoped credentials. Define ownership and revoke or rotate publishing access as soon as it is exposed. Limit GitHub Actions publishing jobs to the minimum permissions needed. | ||
| CIS Controls v8 | 6 — Access Control Management | CI/CD publishing access should be tightly managed and removed when no longer needed. |
| 5 — Account Management | Workflow credentials need ownership, lifecycle control, and timely deprovisioning. | |
| Recommendation — Constrain publishing identities to approved access paths and remove excess rights. Track and retire unused publishing accounts, tokens, and secrets promptly. | ||
| NIST CSF 2.0 | PR.AA — Identity Management, Authentication, and Access Control | Modern pipeline publishing depends on proving job identity and enforcing limited access. |
| PR.DS — Data Security | Secrets in workflows are sensitive data that must be protected from leakage. | |
| DE.CM — Continuous Monitoring | Secret leakage and abnormal workflow use require detection in the release path. | |
| Recommendation — Use strong identity proofing and least-privilege access for CI/CD publish jobs. Protect secrets in transit, at rest, and in workflow outputs. Monitor publishing workflows for secret exposure and suspicious release activity. | ||
| MITRE ATT&CK | T1552 — Unsecured Credentials | Exposed GitHub Actions secrets map directly to credential discovery and abuse. |
| T1195 — Supply Chain Compromise | Compromised publishing workflows can tamper with releases and downstream trust. | |
| Recommendation — Hunt for exposed workflow secrets and remove reusable credentials from pipelines. Protect build and publish dependencies against compromise and release tampering. | ||
Practitioner Guidance
What to prioritise: Treat publishing credentials as release-critical assets. If the workflow can publish externally or touch production-facing systems, make secret exposure and token scope part of your release approval criteria, not an after-the-fact audit item.
What to verify: Confirm that the job uses the narrowest credential possible, that the credential is short-lived, and that the workflow cannot reuse it outside the publish step. Also verify that logs, artifacts, and action outputs cannot accidentally reveal the secret material.
Common mistake: Teams often harden the repository while leaving the publishing identity broad enough to do real damage. The safer design is to make the workflow identity ephemeral and specific to one release path, then rotate or revoke any fallback secret immediately after migration.
Practitioner takeaway: The real control objective is not “keep the build working,” it is “make the publish path trustworthy even if the workflow is partially exposed.” If the credential can outlive the job, it is already too powerful for modern CI/CD.
Related resources from NHI Mgmt Group
- How should security teams implement repository and code protection in GitHub without overwhelming developers with alerts?
- Why do branch protection and code review still miss secret exfiltration attacks in GitHub Actions?
- How should financial institutions govern AI use without weakening identity and data protection controls?
- What breaks when GitHub Actions are allowed to authenticate without tight repository and branch controls?