Restrict Host-based fetches to Steam CDN names #13
Reference in New Issue
Block a user
Delete Branch "security/direct-fetch-host-allowlist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Restricts Host-based origin fetches (empty
upstream) to Steam CDN hostnames and stops following upstream redirects.Why
Default config listens on
:80with emptyupstreamand treats request Host as the origin. A spoofed Steam User-Agent was enough to proxy to LAN IPs / arbitrary names and to fill path-only cache keys.Change
hostAllowedForDirectFetch: allowsteamcontent.com,steampowered.com,steamstatic.com(and subdomains); reject empty Host and literal IPs.CheckRedirectalways returnshttp.ErrUseLastResponse(chunk/manifest traffic is expected to be 200).Test plan
go test ./steamcache/ ./config/make test/ CI on this PRlancache.steamcontent.comor*.steamcontent.com127.0.0.1orevil.examplereturns 400