Cloud & Security · SaaS & Startups

Securing CI/CD Pipelines and GitHub for Startups (2026 Guide)

The OWASP CI/CD risks, the tj-actions lesson and the GitHub settings that stop a pipeline becoming the way in.

XDQ Editors11 Nov 2026 · 11 min read
Team Meeting

A CI/CD pipeline holds the keys to production, which makes it a target. Verizon's 2025 DBIR found third-party involvement in 30% of breaches, double the previous year, and in March 2025 CISA warned that a widely used GitHub Action had been compromised in a way that could expose secrets. This guide covers the OWASP CI/CD risks and the GitHub settings that address them.

30%
Breaches with third-party involvement in 2025, double the prior year
Source: Verizon
10
Risks in the OWASP Top 10 CI/CD Security Risks (v1.0, 2022)
Source: OWASP Foundation
4.6%
Public GitHub repositories containing a secret (GitGuardian 2025)
Source: GitGuardian
v46.0.1
Fixed release of tj-actions/changed-files after CVE-2025-30066
Source: CISA

Why the pipeline is a high-value target

Your CI system can read source code, pull secrets, push images and deploy to production. Anyone who controls a step in it can often do the same. That is why the OWASP Top 10:2025 now names Software Supply Chain Failures as A03, widening the old outdated-components category to cover build systems and third-party tooling. Startups are exposed because they move fast with many third-party actions, broad tokens and few reviewers. The good news is that most protections are configuration, not new products.

The OWASP Top 10 CI/CD Security Risks

OWASP released this list in 2022, with the stable v1.0 following in October that year. The table pairs each risk with a GitHub control a small team can switch on. Most of the controls are settings rather than paid tools, which makes this list a practical starting audit.

RiskWhat it meansGitHub control
CICD-SEC-1 Insufficient Flow ControlCode reaches production without reviewBranch protection, required reviews and checks
CICD-SEC-2 Inadequate Identity and Access ManagementToo many people or bots with too much accessLeast-privilege teams, MFA, remove stale accounts
CICD-SEC-3 Dependency Chain AbuseMalicious or confused packages pulled into buildsDependency review and lockfiles
CICD-SEC-4 Poisoned Pipeline ExecutionAttacker-controlled code runs in your pipelineAvoid running untrusted PR code with secrets
CICD-SEC-5 Insufficient Pipeline-Based Access ControlsPipelines can reach more than they needScoped GITHUB_TOKEN, environment protection
CICD-SEC-6 Insufficient Credential HygieneLong-lived or leaked pipeline secretsOIDC, secret scanning, push protection
CICD-SEC-7 Insecure System ConfigurationWeak runner or CI settingsHardened, isolated runners
CICD-SEC-8 Ungoverned Usage of 3rd Party ServicesUnvetted apps and actions with accessAllowlist actions and review installed apps
CICD-SEC-9 Improper Artifact Integrity ValidationBuilds can be swapped or tampered withPin by SHA, sign and verify artifacts
CICD-SEC-10 Insufficient Logging and VisibilityPipeline abuse goes unnoticedAudit log review and alerts

Lessons from the tj-actions compromise

In March 2025 the GitHub Action tj-actions/changed-files, used to detect changed files in pull requests, was compromised. CISA said the compromise could expose secrets including access keys, GitHub personal access tokens, npm tokens and private RSA keys, assigned it CVE-2025-30066 and added it to the Known Exploited Vulnerabilities Catalog. The fix shipped in version 46.0.1.

The lesson is that a tag such as v46 is a pointer the action's owner, or an attacker, can move. Teams pinned to a reviewed commit SHA were insulated from silent changes. Any team that ran the affected versions needed to treat secrets visible to those workflows as exposed and rotate them.

Pin, review and allowlist third-party actions

GitHub's own guidance states that pinning an action to a full-length commit SHA is currently the only way to use it as an immutable release. Verify the SHA comes from the action's own repository and not a fork, and audit the source of actions that touch secrets.

Pinning has a trade-off: GitHub notes Dependabot alerts do not cover actions pinned to SHAs, so use Dependabot version updates to raise pull requests when new releases appear, and review each one. At organisation level, restrict which actions may run to an allowlist.

Limit tokens and replace stored cloud keys

Set the default GITHUB_TOKEN permission to read-only for repository contents and grant extra permissions per job only where needed. GitHub also reminds teams that anyone with write access to a repository can read all its secrets, so scope each secret to the smallest set of repositories and environments.

Replace long-lived cloud access keys with OpenID Connect, which GitHub and OWASP both recommend. The workflow requests a short-lived token for one job, so there is no static key to leak. GitGuardian's finding that 70% of secrets leaked in 2022 were still valid shows why short lifetimes matter.

Untrusted input and risky triggers

Two patterns cause many pipeline compromises. The first is script injection: inserting a pull request title or branch name straight into an inline shell step. GitHub advises passing such values through an intermediate environment variable or an action argument instead.

The second is pull_request_target and workflow_run, which run with access to secrets and write permissions. GitHub recommends avoiding pull_request_target unless you need it and never checking out untrusted pull request code in those workflows. Self-hosted runners need extra care, because untrusted workflow code can persistently compromise them.

A GitHub hardening checklist for startups

These settings take a few hours across a small organisation and close the most common gaps. Apply them at organisation level where GitHub allows it, so new repositories inherit them, and record any exceptions with a reason and an owner.

  • Require MFA for every organisation member
  • Protect the main branch: reviews, status checks, no force pushes
  • Add .github/workflows to CODEOWNERS so workflow changes need approval
  • Set GITHUB_TOKEN to read-only by default
  • Pin third-party actions to full commit SHAs and allowlist them
  • Use OIDC for cloud deploys; protect production environments with reviewers
  • Enable secret scanning and push protection; free on public repositories
  • Review installed GitHub Apps and personal access tokens each quarter

Budget and next steps

Most of the checklist is free. For private repositories, GitHub sells Secret Protection at USD 19 and Code Security at USD 30 per active committer per month, available to Team plans since April 2025. Start with the free configuration work, then decide whether paid scanning fits your risk. XDQ Labs reviews and hardens CI/CD pipelines for teams that own them, then verifies the fixes, as part of its AI security engineering services.

Frequently asked questions

Why should GitHub Actions be pinned to a commit SHA?

Tags and branches can be moved, so a compromised action can change underneath you, as the 2025 tj-actions incident showed. GitHub's documentation says pinning to a full-length commit SHA is currently the only way to use an action as an immutable release. Use Dependabot to propose reviewed updates.

What is poisoned pipeline execution?

It is CICD-SEC-4 in OWASP's CI/CD risk list. An attacker gets their own commands to run inside your pipeline, for example by changing a build script in a pull request that a privileged workflow then executes. Avoid running untrusted code in workflows with secrets or write access.

Is pull_request_target safe to use?

It can be risky. Workflows triggered by pull_request_target run with access to secrets and write permissions. GitHub recommends avoiding it unless you need privileged context, and never checking out or running untrusted pull request code in such workflows.

How do I stop secrets leaking from CI/CD?

Use OIDC so pipelines get short-lived cloud tokens instead of stored keys, scope remaining secrets to specific environments, set GITHUB_TOKEN to read-only by default, and enable secret scanning with push protection. Do not store JSON blobs as one secret, because log redaction relies on exact matches.

Sources

  1. OWASP Top 10 CI/CD Security Risks, OWASP Foundation, 2022
  2. Secure use reference for GitHub Actions, GitHub Docs, 2026
  3. Supply Chain Compromise of Third-Party GitHub Action, CVE-2025-30066, CISA, 2025
  4. Verizon 2025 Data Breach Investigations Report: news release, Verizon, 2025
  5. The State of Secrets Sprawl 2025, GitGuardian, 2025
  6. Introducing GitHub Secret Protection and GitHub Code Security, GitHub Changelog, 2025
  7. OWASP Top 10:2025 Introduction, OWASP Foundation, 2025
  8. Secrets Management Cheat Sheet, OWASP Cheat Sheet Series, 2025
  9. Push protection is generally available, and free for all public repositories, GitHub Blog, 2023
Keep reading

Related research

Cardboard Box
Cloud & Security · 12 Nov 2026

Securing Microsoft 365 for Small Businesses (2026 Guide)

How a small company should secure its Microsoft 365 tenant: security defaults, admin MFA, passkeys, email protection, device management and the right plan.

XDQ Editors12 Nov 2026 · 11 min read
Transaction Onlinebanking
Cloud & Security · 8 Nov 2026

SPF, DKIM and DMARC Setup and the Gmail and Yahoo Sender Rules

How to set up SPF, DKIM and DMARC on a new domain, and what Gmail, Yahoo and Outlook.com now require before they accept your mail.

XDQ Editors8 Nov 2026 · 12 min read
Cardboard Box
Cloud & Security · 10 Nov 2026

Multi-Factor Authentication for Small Companies: What the Data Says

What the research says about MFA, where it still fails, which methods resist phishing and how a small company can roll it out without lock-outs.

XDQ Editors10 Nov 2026 · 11 min read
Next step

Want your cloud set up and secured properly from day one?

Send the workflow. Our sales experts reply with a scope and a custom quotation within two working days, or a straight answer that it isn't a fit.

Secure by default · find → fix → verify · authorised scope only
Send a brief →enquiry@xdqlabs.com