Skip to content

πŸ›‘οΈ Sentinel: [MEDIUM] Fix Git command injections and config attacks#63

Closed
tachyon-beep wants to merge 2 commits into
mainfrom
sentinel-git-fsmonitor-fix-12815921081369848082
Closed

πŸ›‘οΈ Sentinel: [MEDIUM] Fix Git command injections and config attacks#63
tachyon-beep wants to merge 2 commits into
mainfrom
sentinel-git-fsmonitor-fix-12815921081369848082

Conversation

@tachyon-beep

Copy link
Copy Markdown
Collaborator

🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: Potential arbitrary local code execution when running git subprocess commands against untrusted repositories due to malicious .git/config configurations such as core.fsmonitor.
🎯 Impact: An attacker can get arbitrary code execution on the analysis server/machine running Wardline if the tool scans a malicious Git repository.
πŸ”§ Fix: Add the _SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false") to subprocess.run calls evaluating Git commands in delta.py and legis.py.
βœ… Verification: Ran make test to ensure all functionality is still operational and test assertions for mock run args match the new -c core.fsmonitor=false payload.


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

Passed `_SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false")` to all untrusted Git subprocess executions in delta and legis.

Co-authored-by: tachyon-beep <544926+tachyon-beep@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ 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.

Passed `_SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false")` to all untrusted Git subprocess executions in delta and legis.

Co-authored-by: tachyon-beep <544926+tachyon-beep@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 073ec2f140

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/unit/core/test_delta.py Outdated
Comment on lines +46 to +47
assert mock_run.call_args_list[1].args[0] == ["git", "-c", "core.fsmonitor=false", "rev-parse", "--verify", "--end-of-options", "HEAD~1"]
assert mock_run.call_args_list[2].args[0] == ["git", "-c", "core.fsmonitor=false", "diff", "--name-only", "abc123", "--"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wrap the added argv assertions

The CI lint job in .github/workflows/ci.yml runs uv run ruff check src tests, and pyproject.toml sets line-length = 120; these newly-expanded assertions are 141 and 125 characters, so ruff check tests/unit/core/test_delta.py --select E501 fails before the PR can pass lint. Please split the expected argv lists over multiple lines.

Useful? React with πŸ‘Β / πŸ‘Ž.

if TYPE_CHECKING:
from wardline.scanner.index import Entity

_SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the formatter-required blank line

The same CI job also runs uv run ruff format --check src tests; inserting this top-level constant with only one blank line before the following def makes ruff format --check report the changed source files would be reformatted, so fixing the E501s alone still leaves the PR red. Add the formatter-required extra blank line here and at the matching new constant in src/wardline/core/legis.py.

Useful? React with πŸ‘Β / πŸ‘Ž.

@tachyon-beep tachyon-beep deleted the sentinel-git-fsmonitor-fix-12815921081369848082 branch June 24, 2026 05:54
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