Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2024-05-24 - [Command Argument Injection in Git Clone]
**Vulnerability:** User-controlled repository paths were passed directly to `git clone` without a `--` separator.
**Learning:** `git clone` can interpret paths starting with `-` as options. Since repository names and DIDs are derived from user input, an attacker could potentially inject arbitrary arguments (e.g., `-u` for upload-pack, or `--upload-pack`) leading to command execution or unauthorized file reads.
**Prevention:** Always use `--` before passing paths to command-line utilities like `git` to explicitly signal the end of command-line options.
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/gitlawb-node/src/api/repos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2774,6 +2774,7 @@ pub async fn fork_repo(
.args([
"clone",
"--mirror",
"--",
source_path.to_str().unwrap_or(""),
disk_path.to_str().unwrap_or(""),
])
Expand Down
Loading