Skip to content

fix: extract 53 unsafe expression(s) to env vars#31890

Open
dagecko wants to merge 1 commit into
hashicorp:mainfrom
dagecko:runner-guard/fix-ci-security
Open

fix: extract 53 unsafe expression(s) to env vars#31890
dagecko wants to merge 1 commit into
hashicorp:mainfrom
dagecko:runner-guard/fix-ci-security

Conversation

@dagecko
Copy link
Copy Markdown

@dagecko dagecko commented Apr 3, 2026

Description

This PR hardens CI/CD workflows against supply chain attacks by extracting 53 secrets and expressions from run: blocks into env: mappings across 11 workflow files.

Summary

This PR hardens your CI/CD workflows against supply chain attacks by extracting unsafe expressions from run: blocks into env: mappings.

Rule Severity File Fix
RGS-008 high test-run-enos-scenario-matrix.yml Extracted 22 secrets/outputs to env vars
RGS-008 high test-go.yml Extracted 6 secrets/outputs to env vars
RGS-008 high code-checker.yml Extracted 4 secrets to env vars
RGS-008 high test-enos-scenario-ui.yml Extracted 3 secrets to env vars
RGS-008 high test-run-enos-scenario.yml Extracted 3 secrets to env vars
RGS-008 high test-ui.yml Extracted 2 secrets/outputs to env vars
RGS-008 high benchmark-prevent-performance-degradations.yml Extracted 1 secret to env var
RGS-008 high ci.yml Extracted 1 secret to env var
RGS-008 high plugin-update.yml Extracted 1 secret to env var
RGS-008 high test-run-enos-scenario-containers.yml Extracted 1 secret to env var
RGS-002 high plugin-update-check.yml Extracted 1 unsafe expression to env var

22 additional advisory findings (not auto-fixed, flagged for review):

These are step output interpolations (RGS-019) and other patterns that require manual review.

Why this PR

I've been scanning the top 50,000 GitHub repositories for CI/CD pipeline vulnerabilities over the last 5 weeks as part of an ongoing research effort into the supply chain attack campaign that started with tj-actions in March and has escalated through multiple phases since.

You may notice that I have opened up a lot of PRs - don't take that as a negative. I've been working around the clock on this and monitoring all comms. It may take me an hour or two to get back to a comment you leave.

How to verify

Every change is mechanical and preserves workflow behavior:

  • Expression extraction (RGS-002/008): Moves ${{ }} expressions from run: blocks into env: mappings, preventing shell injection
  • No workflow logic, triggers, or permissions are modified

We've had 22 merges so far including next.js, keras, webpack, svelte, apache/superset, and excalidraw. I created a tool called Runner Guard to assist in my research - it does mechanical, non-AI fixes to reduce hallucinations to zero and produce consistent fixes. If you would like to scan it yourself to validate my work, feel free.

Happy to answer any questions - I'm monitoring comms on every PR.

- Chris Nyhuis (dagecko)

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
    • Revert plan: revert this PR. All changes are additive env mappings.
  • If applicable, I've documented the impact of any changes to security controls.
    • Impact: improves security by preventing shell injection of secrets and expressions.

Automated security fixes applied by Runner Guard (https://github.com/Vigilant-LLC/runner-guard).

Changes:
 .../benchmark-prevent-performance-degradations.yml |  4 +-
 .github/workflows/ci.yml                           |  4 +-
 .github/workflows/code-checker.yml                 | 16 +++-
 .github/workflows/plugin-update-check.yml          |  4 +-
 .github/workflows/plugin-update.yml                |  4 +-
 .github/workflows/test-enos-scenario-ui.yml        | 12 ++-
 .github/workflows/test-go.yml                      | 25 ++++--
 .../test-run-enos-scenario-containers.yml          |  4 +-
 .../workflows/test-run-enos-scenario-matrix.yml    | 93 +++++++++++++++-------
 .github/workflows/test-run-enos-scenario.yml       | 12 ++-
 .github/workflows/test-ui.yml                      |  7 +-
 11 files changed, 132 insertions(+), 53 deletions(-)
@dagecko dagecko requested a review from a team as a code owner April 3, 2026 17:56
@dagecko dagecko requested review from ej-hashi and kporter101 April 3, 2026 17:56
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 2026

@dagecko is attempting to deploy a commit to the HashiCorp Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the github_actions Pull requests that update GitHub Actions code label Apr 3, 2026
@hashicorp-cla-app
Copy link
Copy Markdown

hashicorp-cla-app Bot commented Apr 3, 2026

CLA assistant check
All committers have signed the CLA.

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

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant