Skip to content

🛡️ Sentinel: [CRITICAL/HIGH] Fix local code execution via git in tests - #131

Open
tachyon-beep wants to merge 1 commit into
mainfrom
sentinel/fix-git-subprocess-config-14974807385088975155
Open

🛡️ Sentinel: [CRITICAL/HIGH] Fix local code execution via git in tests#131
tachyon-beep wants to merge 1 commit into
mainfrom
sentinel/fix-git-subprocess-config-14974807385088975155

Conversation

@tachyon-beep

Copy link
Copy Markdown
Collaborator

🚨 Severity: HIGH
💡 Vulnerability: The tests/unit/core/test_gitignore.py file invoked git via subprocess against the project root without overriding git config.
🎯 Impact: This could allow local code execution via a malicious .git/config hook (e.g. core.fsmonitor) if a developer ran the test suite inside an untrusted cloned repository (like a malicious PR or fork).
🔧 Fix: We explicitly define and pass _SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false") into the subprocess.run calls, mirroring the mitigation applied in src/wardline/core/.
✅ Verification: Ran make test locally to ensure the test still functions correctly.

Added a critical learning to .jules/sentinel.md.


PR created automatically by Jules for task 14974807385088975155 started by @tachyon-beep

The tests/unit/core/test_gitignore.py file invoked git via subprocess against the project root without disabling core.fsmonitor. This could allow local code execution via a malicious .git/config if a user ran tests in an untrusted cloned repository. We fix this by passing `_SAFE_GIT_CONFIG`.

Co-authored-by: tachyon-beep <544926+tachyon-beep@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.

Copilot AI review requested due to automatic review settings August 1, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Hardens the git subprocess usage inside the test_gitignore unit test to prevent config-driven local code execution when running tests in an untrusted repository checkout, aligning test behavior with existing mitigations already used in src/wardline/core/*.

Changes:

  • Introduce _SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false") in tests/unit/core/test_gitignore.py.
  • Apply _SAFE_GIT_CONFIG to the git rev-parse and git check-ignore subprocess calls used by the repository-policy test.
  • Document the security learning in .jules/sentinel.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/unit/core/test_gitignore.py Adds and uses a safe git config override to disable core.fsmonitor for git subprocess calls in the test.
.jules/sentinel.md Records the rationale and prevention guidance for applying safe git config overrides in tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants