Skip to content

Reject git option injection in server mode - #57

Open
Hashim1999164 wants to merge 1 commit into
pinterest:masterfrom
Hashim1999164:fix/server-git-argument-injection
Open

Reject git option injection in server mode#57
Hashim1999164 wants to merge 1 commit into
pinterest:masterfrom
Hashim1999164:fix/server-git-argument-injection

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 22, 2026

Copy link
Copy Markdown

Summary

Fixes #55.

HTTP range and branch values were passed as raw git argv entries. A value that begins with a dash (for example an output path flag) could make git write to an attacker chosen path. Revision style arguments that begin with a dash are now rejected, and the HTTP server listens on 127.0.0.1 only.

Test plan

  • Unit tests for validate_git_revision_arg
  • Server Args tests for range and branch option injection
  • unittest for git_stacktrace.tests.test_git and git_stacktrace.tests.test_server

HTTP range and branch params were passed straight into git argv, so a value like --output=path could overwrite files. Reject revision args that start with '-', and bind the server to loopback only.
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.

Argument Injection in --server Mode leads to Arbitrary File Overwrite

1 participant