Skip to content

Feature: allow a small subset of dangerous triggers through #1168

Closed

Description

@woodruffw

A common concern/complaint users have with zizmor is that the dangerous-triggers audit is very sensitive: it flags pull_request_target and workflow_run in a blanket fashion.

Users find this annoying because there are (unfortunately IMO) still some common CI/CD tasks that can only be done with these kinds of privileged triggers, like living comments on arbitrary third-party PRs. In a better world GitHub would provide dedicated safer triggers for those kinds of actions, but we don't live in that world.

The challenge is as follows: there are many conceptually safe things users want to do with dangerous triggers, but it's difficult to statically assert that the way they do those things is itself safe. The classic examples of this are dependency bumps on third-party PRs (typically gives the attacker direct code execution in a privileged trigger) and attempting to generate "fancy" comments or similar on PRs (often allows code execution through template injections).

However, these are just the classic examples: pull_request_target and workflow_run are also dangerous because they grant privileged access to an implicit cache token. Beyond this, they're also dangerous because of code injection vectors that can't be caught by template-injection, like GITHUB_ENV and GITHUB_OUTPUT injections.

Finally, there's a basic precautionary argument for not using pull_request_target and workflow_run: they offer a great deal of privilege, and the precautionary principle says that we should assume that attack techniques against GitHub Actions only get better over time.

With all that said, there really is a subset of 100% safe workflows that use dangerous triggers. These workflows tend to have a "stencil" shape where they only use a small subset of 100% safe workflows.

The following actions are known (or presumed) to be 100% safe to use in pull_request_target, since they were designed explicitly by GitHub to be used in that context:

  • actions/labeler is explicitly documented for use with pull_request_target
  • actions/first-interaction is not documented for use with pull_request_target, but is probably safe
  • Probably a small subset of third-party actions, although these would need to be carefully reviewed and only allowlisted at specific known hashes.

So, the basic idea here would be to allow workflows that contain a dangerous trigger if and only if they only have steps that match the set of known safe actions. No other actions or run: blocks would be allowed.

Previous context: #82 #1163

Activity

  1. woodruffw commented on Apr 30, 2026

    @woodruffw
    MemberAuthor

    #1956 will do this for actions/labeler.

  2. woodruffw commented on Apr 30, 2026

    @woodruffw
    MemberAuthor

    Thanks @jrfnl! I'm actually slightly more hesitant to add those, since they're third-party and could (in principle) become vulnerable under pull_request_target in future releases. But I'll look at each and see if maybe there's specific versions that can be allowed here.

    (Another possibility is flagging them in superfluous-actions or similar, although ATM that audit is limited to just actions that can be replaced by tools rather than by other actions.)

  3. jrfnl commented on Apr 30, 2026

    @jrfnl

    I'm actually slightly more hesitant to add those, since they're third-party and could (in principle) become vulnerable under pull_request_target in future releases.

    Considering GH's track record with (not) applying security by design for actions, that same argument can be made for the GH native actions IMO.

    But I'll look at each and see if maybe there's specific versions that can be allowed here.

    (Another possibility is flagging them in superfluous-actions or similar, although ATM that audit is limited to just actions that can be replaced by tools rather than by other actions.)

    💞

  4. woodruffw commented on Apr 30, 2026

    @woodruffw
    MemberAuthor

    Oh yeah, 100% agreed. It's a little bit ironic to consider GitHub's own code safer here, but in this case it's a small enough action that I feel pretty confident in making an exception for it.

    (There's a larger hard balancing act here, e.g. encouraging people to use git instead of the checkout action. I've considered that, but it seems really aggressive! Curious to hear others' thoughts on that kind of thing.)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions