GHSA-pwf7-47c3-mfhx j178/prek-action vulnerable to arbitrary code injection in composite action

Not scored Published

Attackers can inject arbitrary code via action inputs to execute commands and steal secrets in GitHub Actions workflows.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-pwf7-47c3-mfhx?

GHSA-pwf7-47c3-mfhx is a code injection vulnerability in j178/prek-action, published on 29 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Summary

There are three potential attacks of arbitrary code injection vulnerability in the composite action at action.yml.

Details

The GitHub Action variables inputs.prek-version, inputs.extra_args, and inputs.extra-args can be used to execute arbitrary code in the context of the action.

PoC

- uses: j178/[email protected]
  with:
    prek-version: $(printenv >> $GITHUB_STEP_SUMMARY && echo "0.2.2")
    extra_args: '&& echo "MY_SECRET with a character is: ${MY_SECRET:0:1}a${MY_SECRET:1}" >> $GITHUB_STEP_SUMMARY && echo ""'
  env:
    MY_SECRET: ${{ secrets.MY_SECRET }}

The previous example will print all the environment variables, and it will expose MY_SECRET environment variable value to the summary of the workflow. An attacker could potentially use this vector to compromise the security of the target repository, even passing unnotice because the action will run normally.

Impact

Critical, CWE-94

Which versions are affected by GHSA-pwf7-47c3-mfhx?

1 open source package ship an affected version, including j178/prek-action.

PackageAffectedFixed in
j178/prek-action GitHub ActionsAll versions1.0.6

How do I fix GHSA-pwf7-47c3-mfhx?

Upgrade j178/prek-action to 1.0.6 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is GHSA-pwf7-47c3-mfhx being exploited?

There is no known exploitation of GHSA-pwf7-47c3-mfhx in the wild and no public exploit code.

Sources

Is GHSA-pwf7-47c3-mfhx in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free