Skip to content

fix: extract 3 unsafe expression(s) to env vars#540

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

fix: extract 3 unsafe expression(s) to env vars#540
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 3 secrets from run: blocks into env: mappings.

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 release.yml Extracted 3 TF_DEVEX_COMMIT_GITHUB_TOKEN secrets to env vars

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-008): Moves ${{ secrets.* }} 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.

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

Changes:
 .github/workflows/release.yml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
@dagecko dagecko requested a review from a team as a code owner April 3, 2026 18:10
@hashicorp-cla-app
Copy link
Copy Markdown

hashicorp-cla-app Bot commented Apr 3, 2026

CLA assistant check
All committers have signed the CLA.

@ansgarm
Copy link
Copy Markdown
Member

ansgarm commented May 11, 2026

Hi @dagecko 👋

Thank you for this PR and for the service you're doing for OSS! As far as I understand, this change prevents shell injection if there was something malicious in secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN, correct?

That secret is controlled by us and if someone gains access to set that secret we're in a bigger pickle already if I'm not missing something 😅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants