{"id":"GHSA-pwf7-47c3-mfhx","aliases":[],"status":"published","title":"j178/prek-action vulnerable to arbitrary code injection in composite action","description":"### 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 \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 echo \"0.2.2\")\n    extra_args: '\u0026\u0026 echo \"MY_SECRET with a character is: ${MY_SECRET:0:1}a${MY_SECRET:1}\" \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 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":{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-94"],"published":"2025-09-29T17:51:19Z","modified":"2025-09-29T17:51:20Z","fixes":[{"ecosystem":"GitHub Actions","package":"j178/prek-action","fixed_in":["1.0.6"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"GitHub Actions","package":"j178/prek-action","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.0.5"},{"fixed":"1.0.6"}]}]},{"source":"osv","ecosystem":"GitHub Actions","package":"j178/prek-action","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6"}]}]}],"references":[{"url":"https://github.com/j178/prek-action/security/advisories/GHSA-pwf7-47c3-mfhx","tags":["web"]},{"url":"https://github.com/j178/prek-action/commit/6b7c6ef5c3875c766893b881b40773cd5605bde3","tags":["web"]},{"url":"https://github.com/advisories/GHSA-pwf7-47c3-mfhx"},{"url":"https://github.com/j178/prek-action","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-pwf7-47c3-mfhx","title":"j178/prek-action vulnerable to arbitrary code injection in composite action","description":"### 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 \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 echo \"0.2.2\")\n    extra_args: '\u0026\u0026 echo \"MY_SECRET with a character is: ${MY_SECRET:0:1}a${MY_SECRET:1}\" \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 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","status":"published","published":"2025-09-29T17:51:19Z","modified":"2025-09-29T17:51:20Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:38:59.83883Z"}],"osv":[{"id":"GHSA-pwf7-47c3-mfhx","title":"j178/prek-action vulnerable to arbitrary code injection in composite action","description":"### 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 \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 echo \"0.2.2\")\n    extra_args: '\u0026\u0026 echo \"MY_SECRET with a character is: ${MY_SECRET:0:1}a${MY_SECRET:1}\" \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 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","status":"published","published":"2025-09-29T17:51:19Z","modified":"2025-09-29T17:51:19Z","cvss":[{"version":"3.1","score":9.9,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T15:46:53.700556Z"}]}}
