Why
server/githttp/githttp.go accepts POST upload-pack bodies with no positive body cap; only negative Content-Length is refused. The git http-backend subprocess has no request context or timeout and can outlive a disconnected client. rest/PATH_INFO is only split, not validated for dot segments. server/server.go has no ReadTimeout, WriteTimeout, or MaxHeaderBytes.
Scope
- Reject request bodies over a small cap and require a known
Content-LengthonPOST. - Validate
restagainst the known smart-HTTP endpoints and reject./../NUL segments. - Tie
git http-backendtor.Context(); kill and drain on client disconnect. - Add a clone concurrency semaphore and per-IP limit.
- Configure
ReadTimeout,MaxHeaderBytes, and bounded per-route timeouts. - Add slowloris, oversized-body, and disconnect tests.
Acceptance
- Oversized or malformed Git HTTP requests fail closed.
- A disconnected clone leaves no
git http-backendprocess behind. - Concurrent clone load keeps memory and process counts bounded.