Skip to content

ci: harden cherry-pick action against template injection - #22828

Merged
emilburzo merged 1 commit into
mainfrom
cherry-pick-hardening
Jun 4, 2026
Merged

emilburzo merged 1 commit into
mainfrom
cherry-pick-hardening

Conversation

@emilburzo

Copy link
Copy Markdown
Member

As the cherry-pick action uses the potentially dangerous pull_request_target, move all interpolated fields to the env section, which prevents expanding directly inside the run script where command injection can happen.

There is currently no field that can be abused by a fork. The only potentially dangerous one is the label field, e.g. if someone is able to create custom labels, which requires repository permissions. But we should do it for all fields anyway as good practice.

Reference: https://docs.zizmor.sh/audits/#template-injection


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema and clients have been updated (make gen)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make docs)

@emilburzo emilburzo self-assigned this Jun 3, 2026
@emilburzo
emilburzo requested a review from a team as a code owner June 3, 2026 17:21
Copilot AI review requested due to automatic review settings June 3, 2026 17:21
Comment thread .github/actions/cherry-pick/action.yml Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens the composite cherry-pick GitHub Action against GitHub Actions template injection by ensuring event-derived/context values are not interpolated directly into run: script bodies (particularly important for workflows using pull_request_target).

Changes:

  • Moved github.* event/context interpolations used by shell logic into env: variables and referenced them as normal shell variables in the script.
  • Updated gh api invocation to use the environment-provided repository/issue values rather than inline expressions.
  • Passed the “reason” output into the final step’s environment for safer/cleaner logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/actions/cherry-pick/action.yml Resolved
@codecov

codecov Bot commented Jun 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.31%. Comparing base (d2cc7d4) to head (3e15bde).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22828      +/-   ##
==========================================
+ Coverage   93.29%   93.31%   +0.01%     
==========================================
  Files        1033     1033              
  Lines       60150    60150              
  Branches      400      400              
==========================================
+ Hits        56117    56128      +11     
+ Misses       4033     4022      -11     
Flag Coverage Δ
conformance 36.56% <ø> (+<0.01%) ⬆️
e2e 41.82% <ø> (-0.01%) ⬇️
integration 33.00% <ø> (+<0.01%) ⬆️
rust 0.00% <ø> (ø)
unit 92.23% <ø> (+<0.01%) ⬆️
unit-migrate 92.28% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-3e15bde072987a64a5edadec30c66d2076c304ae
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-3e15bde072987a64a5edadec30c66d2076c304ae

Afterwards, run the upgrade commands from the latest release notes.

@emilburzo
emilburzo force-pushed the cherry-pick-hardening branch from 656acbb to 3e15bde Compare June 4, 2026 06:39
@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 3e15bde
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a211db989c56c0008bb5de9
😎 Deploy Preview https://deploy-preview-22828--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread .github/actions/cherry-pick/action.yml Resolved
@emilburzo
emilburzo merged commit b9d4a56 into main Jun 4, 2026
110 checks passed
@emilburzo
emilburzo deleted the cherry-pick-hardening branch June 4, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants