git archive has no timeout or size cap #124

closed cmc opened this on 2026-09-03 05:16 UTC · ops security · milestone v1.9.0

Discussion

cmc 2026-09-03 05:16 UTC

gitutil.Archive (internal/gitutil/read.go:105) runs with cmd.Run(), no CommandContext, streamed to the client at internal/httpd/web.go:1755. Grep got a 5 s context; Archive did not. A large repository or many concurrent archive requests hold CPU and goroutines for as long as the client stays connected.

Remedy: exec.CommandContext with a deadline and a byte cap on the writer.

closed by commit d99ece54b6 by cmc: gitutil: bound git archive by time and size

2026-09-03 17:27 UTC