Skip to content

🔒 Fix: Scrub environment variables in Worktree Tool git commands - #310

Closed
undivisible wants to merge 1 commit into
mainfrom
fix-worktree-git-env-scrub-15330137404908719705
Closed

undivisible wants to merge 1 commit into
mainfrom
fix-worktree-git-env-scrub-15330137404908719705

Conversation

@undivisible

Copy link
Copy Markdown
Collaborator

🎯 What: Added a call to crate::tools::child_proc::scrub in the run_git function of the Worktree Tool.
⚠️ Risk: If left unfixed, git commands spawned by the Worktree Tool would inherit the parent process's environment variables. This could inadvertently expose sensitive secrets (like API keys, tokens) to the child process and any potential sub-processes or malicious hooks triggered by git.
🛡️ Solution: Applied the scrub function from crate::tools::child_proc to the tokio::process::Command before executing git. This ensures that sensitive environment variables are filtered out, maintaining a secure boundary for child processes.


PR created automatically by Jules for task 15330137404908719705 started by @undivisible

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8bec0dd6-b7d8-4277-a557-b3c5e79ddb55
Commits

Reviewing files that changed from the base of the PR and between 1ba3eb6 and 83b191a.

Files selected for processing: 1
  • src/tools/worktree.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@undivisible

Copy link
Copy Markdown
Collaborator Author

Closing as a duplicate of #304, which proposes the same worktree Git environment scrubbing; that proposal needs Git compatibility testing.

@undivisible undivisible closed this Nov 5, 2026
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing as a duplicate of #304, which proposes the same worktree Git environment scrubbing; that proposal needs Git compatibility testing.

Understood. Acknowledging that this work is a duplicate and is now obsolete, so I will stop work on this task.

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