Skip to content

fix: multiple improvements for gh workflows#6306

Merged
wjones127 merged 1 commit intolance-format:mainfrom
esteban:fix/claude-code-review-security
Mar 26, 2026
Merged

fix: multiple improvements for gh workflows#6306
wjones127 merged 1 commit intolance-format:mainfrom
esteban:fix/claude-code-review-security

Conversation

@esteban
Copy link
Copy Markdown
Contributor

@esteban esteban commented Mar 26, 2026

No description provided.

@github-actions github-actions Bot added the bug Something isn't working label Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Review

Good security hardening for the pull_request_target workflow. The changes are well-aligned.

One item to confirm

Removing COLLABORATOR and CONTRIBUTOR from the if guard: This means PRs from outside collaborators (people with repo push access who aren't org members) and prior contributors will no longer trigger auto-review. If that's intentional, great — just want to confirm it's deliberate since COLLABORATOR often includes trusted contributors with write access.

Minor note

The scoped --allowed-tools now removes access to gh issue view, gh issue list, and gh search. This means the review agent can no longer look up referenced GitHub issues for additional context. Reasonable security trade-off, but worth being aware of if review quality on issue-heavy PRs dips.

No bugs or security issues found. LGTM otherwise.

@kevinjqliu
Copy link
Copy Markdown

perhaps also revert a018e0d

@esteban
Copy link
Copy Markdown
Contributor Author

esteban commented Mar 26, 2026

@kevinjqliu Right, I'm considering seriously. Thank you!

@esteban esteban force-pushed the fix/claude-code-review-security branch from 42a0338 to 8cced49 Compare March 26, 2026 18:20
@kevinjqliu
Copy link
Copy Markdown

yes! and please rotate the github secrets (in case its already compromised)

Copy link
Copy Markdown
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

Some minor suggestions but seems like a good cautious step

uses: anthropics/claude-code-action@26ec041249acb0a944c0a47b6c0c13f05dbc5b44 # v1
uses: anthropics/claude-code-action@673eb13aa77026be5c507eda12322c1a58b80f0b # v1
env:
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: '1'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining what this does?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the right version, hash should be 3ac52d0da9f8ec9ca7b4dc23bb477e36ef9c77a9 for 1.0.79: anthropics/claude-code-action@3ac52d0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, I meant, what is CLAUDE_CODE_SUBPROCESS_ENV_SCRUB? I don't want someone turning it off in the future.

# or https://code.claude.com/docs/en/cli-reference for available options
claude_args: |
--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"
--allowed-tools "Bash(gh pr comment ${{ github.event.pull_request.number }}:*),Bash(gh pr diff ${{ github.event.pull_request.number }}:*),Bash(gh pr view ${{ github.event.pull_request.number }}:*)"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, restricting comment seems fine. The rest are all read-only and it's a public repo right? Would these be a problem?

That being said I don't really see why it would need to see other PRs or issues. I guess the only case I can think of is when a PR is built for an issue and references back to it (e.g. "closes 5472 see issue for rationale")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The risk is that other PRs/comments could be used for prompt injection. For sure this limits the value of Claude Code to a small context of the PR. 🤷🏻‍♂️

Copy link
Copy Markdown
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

IIUC, this will mean reviews won't work for anyone, unless they made the PR from a branch within the repo. Is that correct?

If that's the case, I'm wondering if we should just remove this job and find a different way to run reviews that is more secure. What do you think?

@esteban esteban force-pushed the fix/claude-code-review-security branch from 8cced49 to 2163b67 Compare March 26, 2026 18:36
@wjones127 wjones127 merged commit 2ad415a into lance-format:main Mar 26, 2026
8 checks passed
@kevinjqliu
Copy link
Copy Markdown

kevinjqliu commented Mar 26, 2026

please run uvx --from zizmor zizmor --offline .github/workflows/ see if there are other issues (for this workflow and others)
And other repos!!

wjones127 pushed a commit to wjones127/lance that referenced this pull request Mar 29, 2026
Co-authored-by: Esteban Gutierrez <esteban@lancedb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants