Skip to content

Harden CI lint workflow (supply-chain, untrusted clone, least privilege)#4242

Open
imed91-lab wants to merge 2 commits into
sindresorhus:mainfrom
imed91-lab:harden-ci-lint-workflow
Open

Harden CI lint workflow (supply-chain, untrusted clone, least privilege)#4242
imed91-lab wants to merge 2 commits into
sindresorhus:mainfrom
imed91-lab:harden-ci-lint-workflow

Conversation

@imed91-lab

Copy link
Copy Markdown

This hardens the PR-lint CI, which clones and lints contributor-supplied (untrusted) repositories.

Changes

  • Pin awesome-lint to a fixed version instead of npx awesome-lint (avoids pulling an arbitrary/compromised release at CI time).
  • Isolate the untrusted clone: run git clone with core.hooksPath=/dev/null (no hooks executed), --no-tags, --depth 1, and GIT_ALLOW_PROTOCOL=https.
  • Validate the extracted URL: only accept https://github.com/owner/repo before cloning.
  • Least-privilege token: add permissions: contents: read.
  • Pin actions/checkout to a commit SHA (df4cb1c…, v6).

Notes

The job runs on pull_request (not pull_request_target), so secrets are not exposed; the residual risk addressed here is arbitrary code execution on the runner via a malicious contributor repo. No behavior change for legitimate list submissions.

🤖 Generated with Claude Code

imed91-lab and others added 2 commits June 5, 2026 21:22
- Pin awesome-lint to a fixed version (supply-chain)
- Isolate untrusted clone: disable git hooks, --no-tags, shallow
- Validate the extracted URL (only https://github.com/owner/repo)
- Add least-privilege permissions (contents: read)
- Pin actions/checkout to commit SHA (v6)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The first one is the most interesting

@systhac001-oss

Copy link
Copy Markdown

hi can you send me your WhatsApp number

@Son699491

Copy link
Copy Markdown

hi can you send me your WhatsApp number
+2349035650612

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.

4 participants