Review Outbound Request Authority
Follow URL arrays through workers, redirects, DNS, actual connections, and bounded responses while separating contact from disclosure.
You’re reading a preview. Premium includes the full lesson and specialist practice. View the full curriculum.
A server lends its network position to a URL
Server-Side Request Forgery (SSRF) occurs when untrusted input directs a server-side request beyond the intended destination policy. The server may reach networks or send credentials unavailable to the caller. The review follows the URL all the way to the connection and then separately follows what the caller can observe.
QuoteFinder accepts a JSON array of hotel quote URLs. A Go worker constructs an HTTP request for each, follows redirects under its client configuration, reads the response, and extracts a price. The caller controls destinations even though the API returns only selected fields.
req, err := http.NewRequest(http.MethodGet, target, nil)
if err != nil { return err }
response, err := client.Do(req)
if err != nil { return err }
defer response.Body.Close()
body, err := io.ReadAll(response.Body)
if err != nil { return err }
return extractQuote(body)
A timeout bounds some elapsed behavior; it does not authorize destinations, cap response bytes, or limit fan-out. Go's ordinary HTTP transport is not a general file:// reader. Report the schemes and transports actually supported by the code.