Host-based fetch is an unauthenticated LAN reverse proxy #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Severity: Medium
When
upstreamis empty (the generated default), SteamCache2 fetcheshttp(s)://{request Host}/{path}for any GET whose User-Agent matches the Steam patterns (Steam,SteamClient,Valve/Steam HTTP Client 1.0). Those strings are trivial to send. Combined with the default listen address:80(all interfaces), any host that can reach the cache can:steam/+ SHA256(path) with no Host. A request for the same depot path with a hostile Host fills the entry that real Steam clients will later hit. Steam will usually reject bad chunk hashes (failed downloads), not execute them — still a practical outage for everyone on the LAN cache.This is the intended LAN-cache shape (DNS intercept, Host = CDN name), but there was no check that Host is actually a Steam CDN.
Fix
upstreamis set, keep fetching only that origin (unchanged).upstreamis empty, allow Host only when it is a Steam CDN name (steamcontent.com,steampowered.com,steamstatic.com, including subdomains). Reject literal IPs.*.steamcontent.comstill share one object.Do not bind
:80to the internet; keep this on the LAN. Setupstreamto a known Steam origin if you do not want Host-based fetch at all.A PR with the allowlist + redirect change is open.
Triaged as medium. Merged #13 (CDN Host allowlist + no redirect follow). Leave :80 on the LAN.