Your CI can reach whatever its secrets, tokens and cloud roles can reach, and so can anyone who can edit a workflow file. In November 2026, 1Password and Todoist both traced breaches to a single compromised source-control account or credential. In about an hour you can list every secret, swap cloud keys for OIDC, cut token permissions and lock down who changes workflows.
What happened in November 2026?
In each of these incidents, an attacker got into the build or release path and then used whatever that path could reach. Three of the five started with a stolen account or token, and none needed a software bug.
| Incident | Way in | What it reached |
|---|---|---|
| 1Password (investigation began Nov 19) | An employee’s corporate GitHub account | Pushed malicious code to backend services, copied private source code and got into the CI/CD system, which holds infrastructure secrets. Customer names, emails, account identifiers and some invitation and recovery tokens were taken. Vault data was not. |
| Todoist (Nov 22-23) | A stolen credential for its version control system | Modified automated workflows in three repositories to get more credentials, then got an admin credential for the employee sign-in system through an infrastructure automation workflow |
| SAP (reported Nov 26-27) | Employee authentication tokens, according to Der Spiegel | Copied and changed source code on GitHub. SAP said it found no evidence of access to customer business data. |
| WPPConnect on npm (Nov 15-16) | A compromised maintainer account | Shipped malicious versions through the project’s own GitHub Actions trusted-publishing workflow, with valid SLSA provenance |
| Optimizely (Nov 16) | Write access to customer projects, cause not yet public | Served malware through 188 snippets across 178 organizations, from about 04:21 UTC until most snippets were cleaned around 21:00 UTC |
Todoist’s notice gives the most useful detail. Its remediation included tightening “permissions granted to developer automation” and a review of “all credential permissions to limit what a stolen credential can access.” That review is the subject of this post.
Why do attackers go after CI first?
Because CI is the one place that holds deploy keys, cloud roles and publish rights all together, and it runs whatever the repository tells it to run. Get the repository and you get CI.
What changed this year is the speed. On November 5, Microsoft Threat Intelligence described an AI agent that went from searching GitHub for client secrets to exfiltrating Azure Key Vault data in five minutes. Truffle Security’s analysis of that case makes the point that matters for an audit: the agent could only do what the stolen identity was already allowed to do. The identity behind a secret sets the ceiling. You can’t stop every credential from leaking, but you can lower that ceiling.
Minutes 0-15: what secrets does your CI hold?
Start with names, not values. You’re building a list of what exists, who can use it and which jobs read it.
ORG=your-org
for repo in $(gh repo list "$ORG" --limit 500 --json name -q '.[].name'); do
echo "== $repo"
gh secret list -R "$ORG/$repo" --json name,updatedAt -q '.[] | " repo \(.name) \(.updatedAt)"'
for env in $(gh api "repos/$ORG/$repo/environments" -q '.environments[].name' 2>/dev/null); do
gh secret list -R "$ORG/$repo" -e "$env" --json name -q ".[] | \" env:$env \(.name)\""
done
gh api "repos/$ORG/$repo/keys" -q '.[] | " deploy-key \(.title) read_only=\(.read_only)"'
done
gh secret list -o "$ORG" --json name,visibility,numSelectedRepos
Then, in each repository, see which jobs touch what:
grep -rnE 'secrets\.|id-token|pull_request_target|workflow_run|permissions:' .github/workflows/
For each secret, write down three things: what it can do (read, write, admin, deploy to production), which jobs read it, and when it was last rotated. Org secrets with visibility: all and deploy keys with read_only=false go to the top of the list. If you’re an org owner, gh api orgs/$ORG/installations lists the GitHub Apps installed on the organization. Check each one’s permissions too, because an app’s token is another credential that can reach your code.
Then run zizmor, a static analyzer for GitHub Actions, over your workflows. It flags excessive GITHUB_TOKEN permissions, template injection, unpinned actions, dangerous triggers and credentials that persist on disk:
uvx zizmor .github/workflows/
# or a remote repo
uvx zizmor --gh-token=$(gh auth token) your-org/your-repo
Minutes 15-30: which secrets should become OIDC?
Any long-lived cloud key stored as a CI secret should become an OIDC role if your provider supports it. With OIDC you don’t keep cloud credentials as GitHub secrets at all. Each job asks the provider for a short-lived token instead.
The trust policy is where people get it wrong. A role that trusts repo:your-org/your-repo:* can be assumed by any workflow on any branch, including one an attacker just pushed. Tie production roles to an environment:
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
"token.actions.githubusercontent.com:sub": "repo:your-org/your-repo:environment:production"
}
}
The job needs id-token: write and a reference to that environment:
permissions:
id-token: write
contents: read
jobs:
deploy:
environment: production
runs-on: ubuntu-latest
steps:
- uses: aws-actions/configure-aws-credentials@45666896f5d8e0f10ae255413f3a4cdd03bdc8f5 # v6.3.1
with:
role-to-assume: arn:aws:iam::123456789012:role/deploy-production
aws-region: eu-west-1
One detail from the OIDC reference: repositories created after July 15, 2026 use an immutable default subject format that includes owner and repository IDs, like repo:octo-org@123456/octo-repo@456789:ref:refs/heads/main. Check the sub your repository actually sends before you write the condition.
Minutes 30-40: who can change a workflow file?
Anyone who can merge a change to .github/workflows/ can make CI print or use its secrets, so treat workflow files like production config. Three changes cover most of it.
- Require code owner review for workflows. GitHub’s hardening guide recommends adding
.github/workflowsto CODEOWNERS so changes need an approval. Pair it with a ruleset on the default branch that requires a pull request, a code-owner review and no bypass for admins. - Keep production secrets in an environment. Move deploy credentials from repository secrets to an environment with required reviewers and a deployment branch rule for
main. A workflow pushed to a feature branch then can’t read them. - Watch the dangerous triggers.
pull_request_targetruns with the base repository’s secrets. GitHub will block it by default in public repositories from December 2, 2026, unless an event policy allows it. Private repositories aren’t covered, so check them yourself.
None of this helps if the attacker controls the approving account too. In the 1Password case the stolen account belonged to an employee, and the attacker used it to push code to backend services. Requiring a second person’s review on production paths is the control that survives one stolen account.
Minutes 40-50: how much can your tokens do?
Make every token read-only by default, then grant write access per job where it’s needed.
- For
GITHUB_TOKEN, GitHub’s hardening guide says to set the default permission to read-only. Set it at the org level (Settings, Actions, General, Workflow permissions), then putpermissions: { contents: read }at the top of every workflow and widen it per job. - For personal access tokens, set an org PAT policy: restrict classic tokens, require approval and a maximum lifetime for fine-grained ones. Prefer a GitHub App with repository-scoped permissions for automation.
- Pin your actions. A tag like
@v4can be moved to point at new code. Pin to a full commit SHA and turn on the “Require actions to be pinned to a full-length commit SHA” policy under Actions settings. The alternative is a workflow lockfile, generally available since October 28, 2026: thegh actions-lockextension writes.github/workflows/actions.lockwith a commit SHA for every action, including transitive ones. GitHub’s lockfile docs say a lockfile “also satisfies the separate Require actions to be pinned to a full-length commit SHA policy” for workflows onboarded to it. Lockfiles don’t cover reusable workflows (jobs.<id>.uses), so pin those by SHA. Neither method tells you the pinned code is safe.
Minutes 50-55: does trusted publishing make releases safe?
It removes long-lived tokens from the release path, but a compromised workflow can still publish. npm’s docs say trusted publishing replaces long-lived tokens with short-lived ones tied to your workflow. If the workflow itself is compromised, it publishes whatever it’s given. WPPConnect version 2.4.1 carried valid SLSA provenance even though the malicious code was never reviewed.
Databricks’ study of about 5,400 malicious npm packages (November 23, 2026) shows the shift. Compromised legitimate packages were 7% of the set but over 99% of downloads. Among malicious packages published through trusted publishing, 85% were compromised legitimate packages.
If you publish packages:
- Configure the trusted publisher as stage-only: allow
npm stage publish, notnpm publish. npm says every CI publish then goes through staged publishing, and a maintainer has to approve it with 2FA before it’s public. - Under Publishing access, choose “Require two-factor authentication and disallow tokens.”
- Put the release job in an environment with required reviewers.
Minutes 55-60: who can change the scripts your site loads?
Your CI isn’t the only path to production. A tag manager, A/B testing tool or analytics snippet that loads on every page is deploy access without a pull request. In the Optimizely incident the malicious file was served from Optimizely’s own CDN, which every affected site already trusted, and Report URI counted 188 compromised snippets. List who can publish to each tool, enforce SSO and MFA there, and remove former staff and agencies. The CSP side of this, and why connect-src misses some exfiltration, is in why CSP misses WebRTC skimmers.
What does zizmor flag, and how do you fix it?
On a small pipeline, most zizmor findings come from a handful of audits, and each one has a short fix. A workflow that already has read-only token defaults and step-level secrets can still show several. These are the ones you’re most likely to see, by audit name from zizmor’s audit docs:
| zizmor audit | What it means | Fix |
|---|---|---|
unpinned-uses |
uses: actions/checkout@v4 follows a tag. Whoever controls the action’s repository can move that tag to new code, and your next run executes it. |
Pin to the full commit SHA with the version in a comment, or adopt a lockfile |
artipacked |
actions/checkout defaults to persist-credentials: true, which writes the job’s token into .git/config. Later steps can read it, and so can anyone who downloads an artifact that includes .git. |
Set persist-credentials: false unless a later step really needs to push |
excessive-permissions |
No permissions: block, or write-all, so the token gets whatever the repository default is |
permissions: {} at the top, then the minimum per job |
template-injection |
A value like ${{ github.event.pull_request.title }} is pasted into a shell script before it runs, so a crafted title or branch name becomes code |
Pass the value through env: and use "$VAR" in the script |
dangerous-triggers |
pull_request_target, workflow_run and issue_comment run with the base repository’s secrets on events outsiders can cause |
Use pull_request, or never check out and run the PR’s code in that job. actions/checkout v7 refuses fork PR code in those triggers unless you set allow-unsafe-pr-checkout. |
secrets-outside-env |
A job reads secrets without an environment, so a workflow edited on any branch can read them. Shown only with --persona=auditor. |
Move the secret into an environment with a branch rule and required reviewers |
Run the default persona first and fix the high findings, then run uvx zizmor --persona=auditor .github/workflows/ for the noisier checks.
What can’t zizmor see?
zizmor finds risky patterns in workflow files. It can’t know what a credential is allowed to do, or whether the pipeline’s design puts that credential next to code you didn’t write. Two design gaps are common even on pipelines with no findings at all.
Install steps run before the deploy step. Passing the token only to the deploy step (env: on the step, not the job) is the right default, but it has a limit. If npm ci runs earlier in the same job, every dependency’s install script runs on that machine first. The token isn’t in the environment yet, so the script can’t read it. It can still change files in node_modules, including the deploy tool that runs next with the token. The fix is to split the work. Build in a job with no secrets, upload the output, and deploy from a second job that installs nothing from your lockfile and sits behind an environment. If your CI also installs MCP servers or agent tooling, before you install an AI skill covers checking those first.
Preview deploys use the production credential. Pipelines that deploy a preview for every same-repository pull request often use the production token to do it. Then anyone with push access can open a branch, edit the workflow and run it with that token. Give previews a separate credential that can’t touch production, or let your host build previews itself. Keep the production credential in an environment whose branch rule allows only main. Pull request runs are checked against a refs/pull/.../merge ref, so a main-only rule keeps them out.
Here’s the split version for a static site deployed to S3, with the OIDC role from earlier and no stored cloud key at all:
name: deploy
on:
push:
branches: [main]
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: site
path: dist/
deploy:
needs: build
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: site
path: dist/
- uses: aws-actions/configure-aws-credentials@45666896f5d8e0f10ae255413f3a4cdd03bdc8f5 # v6.3.1
with:
role-to-assume: arn:aws:iam::123456789012:role/deploy-production
aws-region: eu-west-1
- run: aws s3 sync dist/ s3://your-site-bucket --delete
The deploy job never runs npm ci, never checks out the repository and only gets cloud access through the production environment. The SHAs were current releases on November 29, 2026. Let Dependabot or the lockfile keep them up to date.
The same split matters even more for AI coding agents, whose job should hold only a read token. I described one way to build that in containing an AI coding agent with two GitHub Actions jobs, and coding agents without your keys covers sandboxes and token scoping in depth.
What I’d do this week
- Run the inventory script and the grep. Write down each secret’s reach, who uses it and when it was last rotated.
- Run
uvx zizmor .github/workflows/and fix the high findings first, then rerun with--persona=auditor. - Replace long-lived AWS, Google Cloud or Azure keys with OIDC roles tied to a
productionenvironment. - Move production secrets into an environment with required reviewers and a
main-only branch rule. Give preview deploys their own credential. - Split build and deploy into separate jobs, so dependency install scripts never share a job with a deploy credential.
- Set org-wide
GITHUB_TOKENdefaults to read-only, add CODEOWNERS for.github/workflows, and require code-owner review with no admin bypass. - Pin actions to SHAs or adopt
gh actions-lock, then turn on the pinning or lockfile policy. - If you publish to npm: stage-only trusted publishing and “disallow tokens.”
- Rotate anything that was ever in a log, a chat or a public repo. Microsoft’s five-minute case shows how little time you’d have.
- List everyone who can publish to your tag manager and third-party scripts.
If you inherited a codebase and don’t know who still holds keys to it, this post covers taking them back. And if you’d like a second pair of eyes on your pipeline, an architecture and security review is part of my fractional CTO work.