title: Insufficient sanitization of Host header in net/http
description: The HTTP/1 client does not fully validate the contents of the Host header. A maliciously crafted Host header can inject additional headers or entire requests. With fix, the HTTP/1 client now refuses to send requests containing an invalid Request.Host or Request.URL.Host value.
problem types: CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')
affected:
{
vendor: Go standard library
product: net/http
collectionURL: https://pkg.go.dev
packageName: net/http
versions:
version: 0, lessThan: 1.19.11, status: affected, versionType: semver
version: 1.20.0-0, lessThan: 1.20.6, status: affected, versionType: semver
programRoutines:
name: Request.write
name: Client.CloseIdleConnections
name: Client.Do
name: Client.Get
name: Client.Head
name: Client.Post
name: Client.PostForm
name: Get
name: Head
name: Post
name: PostForm
name: Request.Write
name: Request.WriteProxy
name: Transport.CancelRequest
name: Transport.CloseIdleConnections
name: Transport.RoundTrip
defaultStatus: unaffected
}