π‘οΈ Sentinel: [MEDIUM] Fix Git command injections and config attacks#63
π‘οΈ Sentinel: [MEDIUM] Fix Git command injections and config attacks#63tachyon-beep wants to merge 2 commits into
Conversation
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>
|
π 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 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>
There was a problem hiding this comment.
π‘ 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".
| 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", "--"] |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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 πΒ / π.
π¨ Severity: MEDIUM
π‘ Vulnerability: Potential arbitrary local code execution when running
gitsubprocess commands against untrusted repositories due to malicious.git/configconfigurations such ascore.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")tosubprocess.runcalls evaluating Git commands indelta.pyandlegis.py.β Verification: Ran
make testto ensure all functionality is still operational and test assertions for mock run args match the new-c core.fsmonitor=falsepayload.PR created automatically by Jules for task 12815921081369848082 started by @tachyon-beep