Public repositories are exposed because leaked secrets can appear in logs that other parties may read. Private repositories reduce external visibility, but they do not eliminate compromise because the runner can still access and dump secrets during execution. In both cases, teams should assume credential exposure is possible and act as if affected secrets may already be usable.
Why public and private repo exposure differs after an Action compromise
The core difference is visibility, not safety. In a public repository, compromised workflow output can be read by outsiders if secrets or tokens are printed to logs or artifacts. In a private repository, that external exposure is reduced, but the runner still executes with the repo’s permissions, so a malicious action can still read, copy, or exfiltrate usable credentials.
That means the attacker’s opportunity changes, but the blast radius does not disappear. Public repositories make leaked material easier to observe and abuse, while private repositories mainly narrow who can see the leak in the first place. The compromised execution environment remains the real trust boundary in both cases.
When teams treat privacy as a substitute for containment, they underinvest in workflow hardening, token scoping, and secret handling. A private repo can still be the source of downstream compromise if the action has access to cloud keys, publishing tokens, or other secrets that remain valid after the run ends.
What the attacker can still do in either case
Once a GitHub Action is compromised, the attacker’s practical goal is usually to turn workflow execution into credential access, code tampering, or persistence. If the job can read environment variables, mounted secrets, cached files, or cloud federation material, the compromise can extend far beyond the repository itself.
Public repositories add a second problem: leaked values may be visible to anyone who can view the workflow run, logs, or resulting artifacts. That increases the chance of rapid reuse, copying, or automated harvesting. Private repositories reduce casual visibility, but they do not prevent the action from dumping secrets into places the attacker can retrieve during the run.
In both settings, a compromised action can also abuse trust relationships around package publishing, deployment, or cloud federation. If the workflow can mint short-lived credentials or sign releases, the attacker may not need long-term access to keep moving.
How to judge whether the compromise is actually contained
The right question is not whether the repository was public or private, but whether the exposed secret was still usable and what it could reach. A single leaked token that can still authenticate to production systems is a live incident, even if the repository itself was never public.
Use the repository’s visibility as one factor in exposure assessment, not as the decision point. A public repo may require faster log review and broader notification because exposure is easier to verify. A private repo may still require the same secret rotation and access review if the action could have read deploy keys, cloud tokens, or package credentials during execution.
For a practical baseline on securing this workflow surface, the GitHub and GitHub Actions Security Guide covers permissions, runner hardening, action pinning, and workflow injection patterns that determine how much damage a compromise can cause.
Risk and Threat Considerations
Compromised Actions create a trust-chain problem: the workflow can see and emit secrets, and the repository’s visibility only changes how widely that leakage may be observed. Public repositories amplify exposure because logs and artifacts are easier to inspect, while private repositories can still leak usable credentials to the attacker during execution.
Failure mechanism: The malicious action runs inside a trusted job context, reads secret material or metadata the workflow can access, and then exfiltrates it before defenders notice. If the repo is public, leaked values may also be visible to unintended viewers through logs or artifacts.
Impact: Treat the affected secrets as potentially compromised immediately, because the attacker may be able to reuse them for source access, deployment abuse, cloud access, or further supply-chain tampering regardless of repository visibility.
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 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | Workflow compromise can expose secrets through logs or artifacts. |
| NHI-05 — Overprivileged NHI | Compromised Actions exploit excessive workflow permissions and tokens. | |
| NHI-07 — Long-Lived Secrets | Usable long-lived credentials worsen impact after Action compromise. | |
| Recommendation — Prevent secret leakage from workflow logs and artifacts. Reduce workflow and token permissions to the minimum needed. Replace long-lived workflow secrets with short-lived credentials. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Compromised Actions can expose and require rotation of usable credentials. |
| AC-6 — Least Privilege | Workflow permissions determine how much an attacker can access after compromise. | |
| AU-2 — Event Logging | Logs and artifacts can carry leaked secrets from compromised Actions. | |
| Recommendation — Rotate exposed authenticators and invalidate any compromised secret material. Constrain workflow access to the least privilege needed for the job. Log workflow activity without recording sensitive secret values. | ||
Practitioner Guidance
Decision rule: If a compromised action could read any credential that still authenticates outside the workflow run, rotate it first and investigate later. Visibility is a disclosure issue, not a containment guarantee.
What to verify: Check whether the workflow had access to repository secrets, environment secrets, OIDC federation, deployment tokens, package publish rights, or cached material that may have been dumped during execution. Then confirm whether logs, artifacts, or job outputs persisted any sensitive value.
What good looks like: The repository can be public without making secrets discoverable, and a private repository does not rely on secrecy alone for protection. The workflow should run with minimal permissions, short-lived credentials where possible, and clear evidence that leaked material is no longer valid.
Practitioner takeaway: Public and private repositories differ in how visible the leak becomes, but both must be handled as credential-exposure events once an Action is compromised.
Related resources from NHI Mgmt Group
- Why do over-privileged GitHub apps and compromised repository dependencies increase supply chain risk so quickly?
- Why can a compromised GitHub repository create wider security risk even when customer data is not affected?
- How should security teams reduce risk from compromised GitHub Actions workflows?
- Who is accountable when a compromised action leaks repository secrets?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org