Skip to content

fix/batches: reject Git metadata in repository archives - #1366

Merged
cbrnrd merged 1 commit into
mainfrom
carterbrainerd-vuln-142-a-repository-archive-containing-githookspre-commit-achieves
Sep 3, 2026
Merged

fix/batches: reject Git metadata in repository archives#1366
cbrnrd merged 1 commit into
mainfrom
carterbrainerd-vuln-142-a-repository-archive-containing-githookspre-commit-achieves

Conversation

@cbrnrd

@cbrnrd cbrnrd commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

This was brought to our attention via HackerOne.

A repository archive could include a .git directory. During bind workspace setup, src extracted this directory and then ran Git commands on the host. Malicious Git hooks or repository configuration could therefore run code on the host.

Solution

Reject archive entries that resolve inside the root .git directory. The check also handles normalized paths and case-insensitive filesystems.

Verification Evidence

  • go test ./internal/batches/workspace
  • go test ./internal/batches/...
  • Added tests for malicious hooks, repository configuration, normalized paths, and case variants.

@cbrnrd
cbrnrd requested a review from a team September 3, 2026 17:09
@cbrnrd
cbrnrd marked this pull request as ready for review September 3, 2026 17:09
@cbrnrd
cbrnrd merged commit 1bb1362 into main Sep 3, 2026
8 checks passed
@cbrnrd
cbrnrd deleted the carterbrainerd-vuln-142-a-repository-archive-containing-githookspre-commit-achieves branch September 3, 2026 17:55
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