-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Currently, the default for the version input is the special value latest which, as noted in the README, causes the latest released version of the zizmor image to be pulled/run:
Lines 41 to 44 in da5ac40
| version: | |
| description: The version of zizmor to use | |
| required: false | |
| default: latest |
Further, the version input is checked to ensure it is either this special value or a three-part version string that could correspond to a particular zizmor image:
Lines 38 to 41 in da5ac40
| version_regex='^v?[0-9]+\.[0-9]+\.[0-9]+$' | |
| [[ "${GHA_ZIZMOR_VERSION}" == "latest" || "${GHA_ZIZMOR_VERSION}" =~ $version_regex ]] \ | |
| || die "'version' must be 'latest' or an exact X.Y.Z version" |
Lines 63 to 82 in da5ac40
| image="ghcr.io/zizmorcore/zizmor:${GHA_ZIZMOR_VERSION#v}" | |
| # Notes: | |
| # - We run the container with ${GITHUB_WORKSPACE} mounted as /workspace | |
| # and with /workspace as the working directory, so that user inputs | |
| # like '.' resolve correctly. | |
| # - We pass the GitHub token as an environment variable so that zizmor | |
| # can run online audits/perform online collection if requested. | |
| # - ${GHA_ZIZMOR_INPUTS} is intentionally not quoted, so that | |
| # it can expand according to the shell's word-splitting rules. | |
| # However, we put it after `--` so that it can't be interpreted | |
| # as one or more flags. | |
| # | |
| # shellcheck disable=SC2086 | |
| docker run \ | |
| --rm \ | |
| --volume "${GITHUB_WORKSPACE}:/workspace:ro" \ | |
| --workdir "/workspace" \ | |
| --env "GH_TOKEN=${GHA_ZIZMOR_TOKEN}" \ | |
| "${image}" \ |
Considering this action is intended to help detect (among other things) insecure "mutable" references to external GitHub Actions plugins, I find this behavior concerning. In the event that zizmor's supply-chain is compromised and a malicious version of the image is published as latest, any users of zizmor-action that have kept the defaults would be impacted
Users can choose to target an exact version, but as before, if the zizmor supply-chain is compromised I think GitHub Packages would allow an attacker to delete published tags and republish malicious versions under the same tags
Would it be possible to:
- Modify the
versioninput to allow exact image digests - If so, change the default
versionto specify a particular image digest. If not, change the defaultversionto specify an exact three-part version string
I am willing to put in PRs for one/both of these if there is an appetite for these changes