Skip to content

fix/batches: prevent repository archives from enabling Git hooks - #1367

Merged
cbrnrd merged 1 commit into
mainfrom
carterbrainerd-vuln-146-i-can-turn-committed-backslash-filenames-into-host-git-hooks
Sep 3, 2026
Merged

fix/batches: prevent repository archives from enabling Git hooks#1367
cbrnrd merged 1 commit into
mainfrom
carterbrainerd-vuln-146-i-can-turn-committed-backslash-filenames-into-host-git-hooks

Conversation

@cbrnrd

@cbrnrd cbrnrd commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

This issue was brought to our attention via HackerOne.

On Windows, Git repository archive names can contain backslashes that are treated as directory separators during extraction. This can place repository files in Git metadata paths and allow a host-side Git hook to run before the batch step starts.

Solution

Reject archive names that contain backslashes before extracting any files. Also disable hooks for every host-side Git command as a second layer of protection.

This change is intended to merge after #1366, which rejects archive entries that resolve to .git paths.

Verification Evidence

  • go test ./internal/batches/...
  • Windows test binary cross-compiled with GOOS=windows GOARCH=amd64 go test -c ./internal/batches/workspace

@cbrnrd
cbrnrd marked this pull request as ready for review September 3, 2026 17:47
@cbrnrd
cbrnrd requested a review from a team September 3, 2026 17:47
@cbrnrd
cbrnrd force-pushed the carterbrainerd-vuln-146-i-can-turn-committed-backslash-filenames-into-host-git-hooks branch from 38256df to d228bd5 Compare September 3, 2026 17:57
@cbrnrd
cbrnrd enabled auto-merge (squash) September 3, 2026 18:00
@cbrnrd
cbrnrd merged commit 3812c34 into main Sep 3, 2026
7 checks passed
@cbrnrd
cbrnrd deleted the carterbrainerd-vuln-146-i-can-turn-committed-backslash-filenames-into-host-git-hooks branch September 3, 2026 18:03
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.

2 participants