Skip to content

ci: Fix CodeQL workflow findings - #2643

Merged
joshuarli merged 1 commit into
mainfrom
ci/codeql-workflow-hardening
Oct 20, 2026
Merged

joshuarli merged 1 commit into
mainfrom
ci/codeql-workflow-hardening

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Fixes what CodeQL's default code-scanning suites (python + actions) report on current main. The Python suite has no findings. The actions suite has 7:

  • actions/cache-poisoning/code-injection in pre-commit.yml: ${{ steps.changes.outputs.all_files }} was expanded straight into the run: script. On a push to main, a crafted file name could inject shell into a job that writes the default-branch cache. The value now goes through an env var, and xargs -d '\n' keeps file names intact.
  • actions/missing-workflow-permissions (6) in auto-merge, build (×2), image, pre-commit and test: each now sets explicit GITHUB_TOKEN permissions:
    • contents: read everywhere.
    • pull-requests: write for auto-merge's gh pr review --approve.
    • packages: write for the ghcr.io push in image.
    • pull-requests: read for dorny/paths-filter in pre-commit.
    • collect-and-deploy keeps its existing job-level id-token: write.

After the change, a local CodeQL 2.27.3 run against this branch (actions-code-scanning.qls) reports 0 results.

I couldn't read this repo's alert list. The GitHub App lacks security_events: read, so this is based on a fresh local scan, not the open alerts. Alerts that no longer reproduce on main should close on the next default-setup scan.

via @joshuarli.

--

View Junior Session [Sentry]

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 918df15. Configure here.

Comment thread .github/workflows/build.yml Resolved
@joshuarli
joshuarli merged commit 8f2b3a5 into main Oct 20, 2026
22 checks passed
@joshuarli
joshuarli deleted the ci/codeql-workflow-hardening branch October 20, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant