GHSA-pwf7-47c3-mfhx: J178/prek action J178/prek-action Vulnerable To Arbitrary Code Vulnerability

CRITICAL
CVSS 9.9
CWE-94
Published
Advisory Summary

GHSA-pwf7-47c3-mfhx is a CRITICAL (CVSS 9.9) j178/prek-action vulnerable to arbitrary code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting J178/prek action libraries in the GitHub Actions ecosystem. The issue involves j178/prek-action vulnerable to arbitrary code injection in composite action. Remediation is available by upgrading affected packages to version 1.0.6.

GHSA-pwf7-47c3-mfhx at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pwf7-47c3-mfhx
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product J178/prek action
Package Ecosystem GitHub Actions
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-pwf7-47c3-mfhx

To remediate this vulnerability, upgrade all affected J178/prek action dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

j178/prek-action fixed: 1.0.6
Upgrade j178/prek-action to 1.0.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for j178/prek-action

How to Check if You Are Affected

To determine whether your application is affected by GHSA-pwf7-47c3-mfhx, inspect your project dependencies for J178/prek action:

inspect dependencies for j178/prek-action

Analyze the terminal output to locate any version of J178/prek action in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.6), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In J178/prek action, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 ```yaml - uses: j178/prek-action@v1.0.5 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

GHSA-pwf7-47c3-mfhx Affected J178/prek action Versions

1 component(s)
Fixed Versions:
1.0.6
Product / Package Ecosystem Affected Versions Fixed Version
j178/prek-action
GitHub Actions
< 1.0.6
1.0.6

References

Frequently Asked Questions

What is GHSA-pwf7-47c3-mfhx?
GHSA-pwf7-47c3-mfhx is a security vulnerability in J178/prek action involving j178/prek-action vulnerable to arbitrary code injection in composite action under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which J178/prek action versions are affected?
Affected versions include releases prior to 1.0.6 across affected packages: j178/prek-action.
What version fixes GHSA-pwf7-47c3-mfhx?
Upgrading to 1.0.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is j178/prek-action affected?
Yes, j178/prek-action is affected in releases prior to 1.0.6. Upgrade your dependency to 1.0.6 or later.
What is the CVSS score of GHSA-pwf7-47c3-mfhx?
GHSA-pwf7-47c3-mfhx has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-pwf7-47c3-mfhx?
GHSA-pwf7-47c3-mfhx is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check GitHub Actions dependencies for GHSA-pwf7-47c3-mfhx?
Run the dependency tree command: 'inspect dependencies for j178/prek-action'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pwf7-47c3-mfhx",
  "modified" : "2025-09-29T17:51:19Z",
  "published" : "2025-09-29T17:51:19Z",
  "aliases" : [ ],
  "summary" : "j178/prek-action vulnerable to arbitrary code injection in composite action",
  "details" : "### Summary\nThere are three potential attacks of arbitrary code injection vulnerability in the composite action at _action.yml_.\n\n### Details\nThe 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.\n\n### PoC\n```yaml\n- uses: j178/prek-action@v1.0.5\n  with:\n    prek-version: $(printenv >> $GITHUB_STEP_SUMMARY && echo \"0.2.2\")\n    extra_args: '&& echo \"MY_SECRET with a character is: ${MY_SECRET:0:1}a${MY_SECRET:1}\" >> $GITHUB_STEP_SUMMARY && echo \"\"'\n  env:\n    MY_SECRET: ${{ secrets.MY_SECRET }}\n```\n\nThe 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.\n\n### Impact\nCritical, CWE-94",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "GitHub Actions",
      "name" : "j178/prek-action"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/j178/prek-action/security/advisories/GHSA-pwf7-47c3-mfhx"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/j178/prek-action/commit/6b7c6ef5c3875c766893b881b40773cd5605bde3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/j178/prek-action"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-29T17:51:19Z",
    "nvd_published_at" : null
  }
}