· via dev.to (home feed)
A 30-minute grep audit for the six GitHub Actions misconfigurations that get exploited
A dev.to guide lists the six GitHub Actions misconfiguration classes most likely to be exploited — from unpinned actions to pull_request_target abuse — and shows the grep commands that surface each one in about 30 minutes.

A guide published on dev.to argues that most GitHub Actions breaches do not need a novel exploit to succeed. According to the post, the entry point is usually plain configuration: a tag that can be repointed, a token carrying more privileges than the job needs, or a workflow that runs a fork's code while repository secrets are in scope. The author groups the problems into six classes, supplies a grep command for finding each one, and estimates that a full pass over a typical repository takes about 30 minutes.
The six misconfiguration classes
Actions pinned to movable tags. A reference like
actions/checkout@v4points at a tag, and tags can be moved. The post explains that if the account behind a widely used action is compromised, an attacker can repoint the tag so the next run executes their code with the job's token and repository secrets available. The fix is pinning every action to its full 40-character commit SHA, keeping the readable version in a comment, and letting Dependabot propose SHA updates as reviewable pull requests so pinning does not mean freezing.Missing or over-broad token permissions. Without an explicit
permissions:block, the built-in GITHUB_TOKEN inherits the repository default, which the post says still means broad read and write access in many repos. Any compromised step inherits all of it, including the ability to push code, edit releases or merge pull requests the job never needed. The recommended pattern declarescontents: readat the top of the workflow and grants write only to the specific job that requires it.pull_request_targetrunning fork code. This trigger executes in the context of the base repository, with its secrets and a write-capable token. The post warns it stays safe only while the workflow never executes code from the pull request; once it checks out the PR head to build, test or install, anyone able to open a fork PR can run arbitrary code with those credentials. The fix is to split the workflow in two: an untrustedpull_request-triggered job touches the PR code and uploads artifacts, and a trustedworkflow_run-triggered job downloads them for labelling, commenting or publishing.Expression injection in run steps. GitHub substitutes
${{ }}expressions before the shell sees the command, so interpolating attacker-controlled text — a PR title, branch name, issue body or commit message — directly into arun:step hands the attacker part of your script. The fix is routing event data through an environment variable and quoting it, so the shell treats it as inert data.Long-lived personal access tokens. A PAT stored as a secret often outlives its task, carries its owner's full permissions, and works from anywhere if leaked — unlike the built-in token, which the post notes is scoped to one repo and dies with the job. The suggested decision order is the built-in token first, then a fine-grained PAT limited to one repository and one permission, then a short-lived GitHub App token. Checkout steps that do not need persisted credentials should set
persist-credentials: false.Remote installers piped into a shell. A curl-to-bash pattern executes whatever the URL serves at that moment, over an unpinned connection and with no record of what ran; a hijacked domain turns CI into the distribution channel, according to the post. The alternative is downloading a pinned version and verifying a checksum before executing anything, or using the tool's official setup action — itself pinned to a full SHA.
The 30-minute audit
The six searches need no scanner subscription or security team, the post argues: run in order, they produce a short findings list of file, line, class and fix. The author recommends starting with release and deploy workflows that hold production credentials, since those are the highest-value targets, and applying fixes as small, reviewable diffs one class at a time. The last step is a CI gate that fails any PR reintroducing an unpinned action, a missing permissions block, a PR-head checkout under pull_request_target, or direct event interpolation, so the pass does not have to be repeated from memory every quarter.
One caveat: the post is partly promotional. It closes by selling a hardening kit for USD 59 and a fixed-price audit sprint for USD 800 from the author's consultancy, though the six classes, the search commands and the fix patterns are described in full in the post itself.
Why it matters
CI pipelines hold production credentials, release rights and publish access, which makes a misconfigured workflow a supply-chain exposure rather than a hygiene issue. GitHub Actions' defaults — mutable tags, generous token permissions, powerful event triggers — make these six classes easy to introduce and easy to overlook, and a single compromised step can push code or modify releases with whatever its token allows. Because every failure mode here is visible in committed YAML, a half-hour grep pass plus an enforcement gate gives a team most of the benefit of a commercial scanner for the cost of one afternoon.
- #github-actions
- #ci-cd
- #security
- #supply-chain
- #devops