Why
cloneBase/lfsObjectBasederive public URLs fromHostandX-Forwarded-Proto; prefer configuredpublic_urlor emit relative URLs, and validate trusted proxy headers.- The CSP still allows inline styles; some security headers are missing.
- Plain-tar archive concurrency is unbounded while gzip is bounded.
- Code search, compare/merge-tree, blame, and history have no request timeouts or semaphores.
- The UI builds
http://<repo>.<pages_domain>links even when the forge is HTTPS.
Scope
- Use configured
public_url(or relative URLs) for clone/LFS/artifact links. - Add
Permissions-Policy,Cross-Origin-Opener-Policy,Cross-Origin-Resource-Policy, andobject-src 'none'. - Remove
style-src 'unsafe-inline'if feasible. - Consider an
Origin/Referercheck in addition to the CSRF token. - Bound plain-tar archive concurrency.
- Add timeouts/semaphores to search, compare, blame, and history.
- Serve site links over HTTPS when the forge is HTTPS.
- Document same-site risk if
pages_domainshares a registrable domain with the forge.
Acceptance
- Host-header injection does not change generated download/clone URLs.
- Archive/search endpoints have bounded concurrency and timeouts.