Restrict Host-based fetches to Steam CDN names #13
No reviewers
Labels
No labels
blocked
bug
draft
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/steamcache2!13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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