π‘οΈ Sentinel: [CRITICAL/HIGH] Fix local code execution risk in Git invocations#70
π‘οΈ Sentinel: [CRITICAL/HIGH] Fix local code execution risk in Git invocations#70tachyon-beep wants to merge 2 commits into
Conversation
Adds `_SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false")` to `subprocess.run` calls
that invoke `git` in untrusted directories. This prevents arbitrary local code execution
if a directory being scanned contains a malicious `.git/config` file.
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. |
Fixes line too long ruff lint errors in `tests/unit/core/test_delta.py` by formatting with `make format`. 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: d476c974e8
βΉοΈ 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 new argv assertions to keep lint passing
In this repo make lint runs ruff check src tests, and these updated expected-argv literals now exceed the configured 120-character line length: ruff check tests/unit/core/test_delta.py reports E501 on both lines. Any CI path using the lint target will fail before exercising the security fix, so split these lists across lines.
Useful? React with πΒ / π.
π¨ Severity: CRITICAL
π‘ Vulnerability: The application invokes
gitcommands viasubprocess.runwithout specifying-c core.fsmonitor=falsein directories that may contain untrusted code. This allows local code execution via a malicious.git/configfile overriding git settings or hooks.π― Impact: An attacker could place a malicious
.git/configinside a directory. When the victim scans that directory using Wardline, git commands likegit rev-parseorgit statuswould execute the attacker's script, resulting in full local code execution.π§ Fix: Applied
_SAFE_GIT_CONFIG = ("-c", "core.fsmonitor=false")to allgitsubprocess commands insrc/wardline/core/delta.pyandsrc/wardline/core/legis.py. Updatedtests/unit/core/test_delta.pyto match the exactsubprocess.runarguments including-c core.fsmonitor=false.β Verification: Ensure the test suite passes with
make test. Ensure thatgrep -rn "subprocess\.run(.*git" src/wardline/core/no longer shows any git invocations without*_SAFE_GIT_CONFIG.PR created automatically by Jules for task 7919555956177251259 started by @tachyon-beep