Skip to content

[REVIEW] pipeline-security: add workflow_run artifact handoff evidence gates #2062

@shensz2017

Description

@shensz2017

Skill Review ($25 Bounty)

Skill Reviewed

Skill name: pipeline-security
Skill path: skills/devsecops/pipeline-security/SKILL.md

Gap Found

The skill flags dangerous pull_request_target usage and generic artifact integrity gaps, but it does not explicitly review privileged workflow_run handoffs where a high-permission workflow downloads artifacts, caches, coverage reports, or build outputs created by a lower-trust PR/fork workflow.

Why It Matters

A successful upstream PR build does not prove that its artifacts are safe to execute or publish in a downstream workflow with write permissions, secrets, signing keys, package tokens, or deployment credentials. Without source repository, branch, actor, artifact digest, provenance, and trusted commit binding checks, PR-controlled artifacts can become a poisoned pipeline execution path even when pull_request_target is not used.

Evidence Pattern That Should Fail

  • pull_request workflow from forks uploads dist artifact
  • workflow_run publish workflow triggers on completed PR build
  • downstream workflow has permissions: write-all and publishing/deployment secrets
  • downstream job downloads the artifact from github.event.workflow_run.id
  • downstream job executes ./dist/release.sh
  • no trusted head repository/branch checks, digest verification, or provenance verification

Suggested Fix

Add evidence gates requiring:

  • producer workflow, trigger, head repository, head SHA, artifact/cache identity, and consumer workflow mapping
  • checks for trusted source repository, branch, actor/team, and event type before privileged consumption
  • artifact digest, signature, SLSA provenance, or rebuild-from-trusted-source before executing/publishing artifacts
  • cache key isolation so untrusted PRs cannot poison caches later restored by release/deploy workflows
  • explicit report section for privileged workflow handoffs

Bounty Info

  • I have read and agree to the CONTRIBUTING.md bounty terms
  • Preferred payment method: GitHub Sponsors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions