Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@
./scripts/review.sh <PR_NUMBER> [model]
```

**Warning:** If you run `scripts/review.sh`, you must have first verified
that the code for the PR being reviewed is safe to run and does not contain
data exfiltration attacks.

**Authors are strongly encouraged to run this script on their own PRs**
immediately after creation. This allows you to catch and fix simple issues
locally before a maintainer performs a full review.

**Note on Models:** By default, the script uses the latest Pro model
(`gemini-3.1-pro-preview`). If you do not have enough Pro quota, you can run

Check warning on line 89 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / Lint

Found sensitive keyword "gemini-3.1". Please make sure this change is appropriate to submit.
it with the latest Flash model instead:
`./scripts/review.sh <PR_NUMBER> gemini-3-flash-preview`.

Expand Down
6 changes: 4 additions & 2 deletions scripts/review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
exit 1
fi
pr="$1"
model="${2:-gemini-3.1-pro-preview}"

Check warning on line 13 in scripts/review.sh

View workflow job for this annotation

GitHub Actions / Lint

Found sensitive keyword "gemini-3.1". Please make sure this change is appropriate to submit.
REPO="google-gemini/gemini-cli"
REVIEW_DIR="$HOME/git/review/gemini-cli"

Expand Down Expand Up @@ -70,8 +70,10 @@
cd "$WORKTREE_PATH" || exit 1

# 4. Checkout the PR
echo "review: Checking out PR $pr..."
gh pr checkout "$pr" -f -R "$REPO"
echo "review: Cleaning worktree and checking out PR $pr..."
Copy link
Contributor

Choose a reason for hiding this comment

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

security-critical critical

The pull request title claims to "warn about running scripts/review.sh on untrusted code," but the implementation fails to add any such warning. The script proceeds to execute npm install (line 86) and npm start (line 131) on code checked out from an external Pull Request. This allows for Remote Code Execution (RCE) if the PR contains malicious code (e.g., in package.json scripts). The absence of the promised warning significantly increases the risk of a developer compromising their machine.

Suggested change
echo "review: Cleaning worktree and checking out PR $pr..."
echo "WARNING: This script will install and run code from PR $pr. Only run this on trusted code."
read -p "Do you want to continue? (y/N) " confirm
if [[ $confirm != [yY] ]]; then exit 1; fi
echo "review: Cleaning worktree and checking out PR $pr..."

git reset --hard
git clean -fd
gh pr checkout "$pr" --branch "review-$pr" -f -R "$REPO"

# 5. Clean and Build
echo "review: Clearing possibly stale node_modules..."
Expand Down
Loading