Skip to content

BUG: ISSUE-707 is never evaluated for job-level reusable workflow uses #462

Open

Description

@SaboniAmine

BUG: ISSUE-707 is never evaluated for job-level reusable workflow uses

Version

plumber version 0.4.51
  commit: 2dbf0c51f59bd67b247ea6d5fc3c50fcd7a309ad
  built:  2026-09-01T09:57:12Z

That is the binary on PATH (/opt/homebrew/bin/plumber). ml/plumber-data/oracle/PLUMBER_PIN.md
still records the pin as 3b308ffa808f70522aee42bdca07ebba40a65418; that divergence is recorded
there and is not part of this report.

What happens

A fabricated 40-hex SHA at step level (jobs.<id>.steps[].uses) fires ISSUE-707. The same
fabricated SHA at job level (jobs.<id>.uses: owner/repo/.github/workflows/x.yml@<sha>) fires
nothing. Surfaced while cutting github-remediation v2.2.3.

The job-level ref is not invisible to the CLI. It is parsed, it is inventoried, and sibling
controls flag it: ISSUE-713 (unauthorized source) fires on it, and it is counted in the
impostor control's own denominator. It is only the upstream-existence question that is never
asked about it.

Two places in the code, and either alone is sufficient:

  • github/github_workflows.go, the metadata enrichment loop, walks pipeline.Jobs[i].Uses
    only. job.ReusableWorkflowUses is never handed to client.Resolve, so it never carries an
    ActionMetadata and refKnownAbsent cannot be set on it.
  • policies/impostor_commit.rego iterates job.uses[j] only, so even with metadata attached
    the rule would not see a job-level ref.

control/github_stats.go already has the mirror block this control is missing: after the
job.Uses loop it adds a job.ReusableWorkflowUses block that folds the job-level ref into
actionRefsTotal / actionRefsUnpinned / actionRefsExempt, with a comment explaining that
job-level calls are subject to the same pin-by-SHA rule as step-level refs and that reports used
to show "0 unpinned" alongside ten unpinned reusable workflows. That is exactly the shape of
this bug, one control over: the denominator was fixed, the existence check was not.

Reproduction

One repository, two workflows, one identical fabricated SHA:

# .github/workflows/step-level.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: peaceiris/actions-gh-pages@4f9cc6602b3c52e6dd3ff78e1a74bbf0d0a45c9a
# .github/workflows/job-level.yml
jobs:
  deploy:
    uses: peaceiris/actions-gh-pages/.github/workflows/release.yml@4f9cc6602b3c52e6dd3ff78e1a74bbf0d0a45c9a
$ plumber analyze --output out.json

Observed

Report:

  Actions must pin commits that exist upstream (1 issue)
      Action Refs Checked: 2
      Impostor Refs Found: 1

         CRIT  [ISSUE-707] job "step-level/deploy" pins action
         "peaceiris/actions-gh-pages@4f9cc6602b3c52e6dd3ff78e1a74bbf0d0a45c9a" to a commit SHA
         that does not exist in the upstream repository
         at .../.github/workflows/step-level.yml:9

out.json:

impostorCommitResult.metrics = {"actionRefsAbsentUpstream": 1, "actionRefsTotal": 2}
impostorCommitResult.issues  = [ one ISSUE-707, file ".github/workflows/step-level.yml" ]

authorizedActionSourcesResult.issues = [
  ISSUE-713, file ".github/workflows/job-level.yml",
             uses "peaceiris/actions-gh-pages/.github/workflows/release.yml@4f9cc...",
  ISSUE-713, file ".github/workflows/step-level.yml", ...
]

Both refs are in the denominator (actionRefsTotal: 2), both are visible to ISSUE-713, one can
ever appear in the numerator. "Action Refs Checked: 2" is not true of this control: one of the
two was counted, not checked.

Expected

The same upstream-existence lookup for jobs.<id>.uses as for steps[].uses, producing an
ISSUE-707 finding on a job-level ref whose SHA is confirmed absent upstream, and counted in
actionRefsAbsentUpstream. If a job-level ref is deliberately out of scope, the reported
denominator should exclude it so "checked" means checked.

Note the ref shape differs: owner/repo/path/to/workflow.yml@<sha> rather than
owner/repo@<sha>, so the owner/repo split has to tolerate the extra path segments before the
@. The existing splitActionRef handling for job-level refs used by ISSUE-713 is the
precedent.

Impact

A fabricated or removed SHA on a reusable workflow call is exactly as dangerous as one on a
step: GitHub Actions silently falls back to the default branch on an unresolvable ref, so the
job runs code the pin does not name. Job-level calls are the shape used for shared release and
deploy workflows, which is the highest-privilege half of most estates.

For the eval datasets it also means job-level pin tasks cannot be labelled or scored against
this control at all, so a solver that fabricates a SHA at job level is indistinguishable from
one that pins correctly.

Notes

  • Related, filed separately: ISSUE-707 goes silent and leaves no degraded marker when the
    upstream lookup cannot be completed.
  • Reproduced locally on 0.4.51 in the tree above. The lookups resolved through the go-gh
    credential chain, so the step-level finding is a real API answer, not a cached one, and the
    asymmetry is not an artefact of a spent quota. The two code paths named above confirm it
    independently of any run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions