fix: reject --pathspec-from-file to prevent log disclosure - #777
Conversation
Git interpolates unmatched pathspecs into fatal errors, so these options can copy an arbitrary runner file into the action log. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: π Files selected for processing (6)
Included review availability: Your plan includes up to 4 reviews per rolling hour; 2 remain after this review. π WalkthroughWalkthroughThe action now rejects Git pathspec file-reading options and their abbreviations during argument validation. Documentation describes the restriction. Unit and integration tests cover rejection, dry-run behavior, unchanged HEAD state, and non-disclosure of pathspec file contents. ChangesPathspec file-option restriction
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: βͺ Minimal Β· up to The PR rejects file-based pathspec options before Git runs to prevent argument contents from being logged; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant ActionInputs
participant matchGitArgs
participant GitCommand
ActionInputs->>matchGitArgs: validate Git arguments
matchGitArgs-->>ActionInputs: reject pathspec file option
ActionInputs-->>GitCommand: do not execute Git command
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
--pathspec-from-fileand--pathspec-file-nul(including unique Git abbreviations) inmatchGitArgsbefore any Git command runs.fatal: pathspec 'β¦'errors that the action logs.Test plan
npm test(pre-commit already passed: 87 tests + lint +lib/rebuild)add: --pathspec-from-file=<outside-file> --pathspec-file-nulfails withnot allowedand does not print the file contentsadd: '.'commit still worksMade with Cursor
Summary by CodeRabbit
Security
Documentation
Bug Fixes