Skip to content
shiporbreak

No streak yet

Sign in

November 7, 2026 路 #52

GitHub ActionsEasyOpen write-up

A lint job with write access

This workflow only runs a linter on every push. Which line gives a compromised dependency the most power?

name: lint
on: push
permissions: write-all
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npx eslint .

Next puzzle in UTC

One try. The first answer sticks.

How to fix it

A lint job needs to read code. write-all gives npm install scripts and every action a GITHUB_TOKEN that can write to the repo. Grant contents: read.

GITHUB_TOKEN is available to every step of the job. npm ci runs install scripts from hundreds of packages, so one compromised dependency can read the token and use it before the job ends: push a commit to main, tag a release, or rewrite a workflow file. write-all turns a bad dependency into a repository takeover.

The default token permissions depend on the repository or organization setting. New repositories default to read-only, but an explicit write-all overrides that.

Fix

permissions:
  contents: read

Grant extra scopes per job only where needed, for example pull-requests: write on the job that comments. Set the organization default to read-only so workflows without a block start safe.

Sponsor this spot

Put your tool on the puzzle
One labeled card, in front of engineers who show up every day from YouTube, TikTok, and Instagram.