CVE-2019-14809: Incorrect parsing validation in net/url
Summary
CVE-2019-14809: Incorrect parsing validation in net/url. Affects stdlib across 2 version ranges.
< 1.11.13
>= 1.12.0-0, < 1.12.8
Fixed in 1.11.13 or 1.12.8, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The stdlib package in Go provides a set of standard libraries for various functionalities. The net/url package is part of the stdlib and is responsible for parsing and manipulating URLs. It offers functions like url.Parse to parse URLs and extract their components. However, a vulnerability exists in the parsing validation of net/url, which allows for the acceptance of URLs with malformed hosts. This means that the Host field can have arbitrary suffixes that do not appear in the Hostname() or Port() functions. This vulnerability can lead to authorization bypasses in certain applications.
Vulnerability Detail
The vulnerability arises from the incorrect parsing validation in the net/url package. By accepting URLs with malformed hosts, an attacker can exploit this flaw to bypass authorization mechanisms in specific applications. The Host field can be manipulated to include suffixes that are not recognized by the Hostname() or Port() functions, allowing unauthorized access to restricted resources. This vulnerability can have severe consequences, compromising the security and integrity of affected applications.
How To Fix
Latest published version: go1.25.5 as of 22 Oct 2026
go get stdlib@vgo1.25.5
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 1.11.131.11.13go get stdlib@v1.11.13 -
>= 1.12.0-0, < 1.12.81.12.8go get stdlib@v1.12.8
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If upgrading to a fixed version of the Go stdlib package is not immediately feasible, a possible workaround is to implement additional validation checks on the parsed URL. This can involve manually verifying the host field against the expected hostname and port, disregarding any unrecognized suffixes. Here is an example of how this can be done in Go:
import (
"net/url"
"strings"
)
func validateURL(rawURL string) (*url.URL, error) {
parsedURL, err := url.Parse(rawURL)
if err != nil {
return nil, err
}
expectedHost := "example.com"
expectedPort := "8080"
host := parsedURL.Hostname()
port := parsedURL.Port()
if host != expectedHost || port != expectedPort {
return nil, errors.New("Invalid URL")
}
return parsedURL, nil
}
Conclusion
The incorrect parsing validation vulnerability in the net/url package of the Go stdlib can lead to authorization bypasses in certain applications. It is crucial to update the affected package to a fixed version, such as 1.11.13 or 1.12.8, or later, to mitigate this vulnerability. If immediate upgrading is not possible, implementing additional validation checks on the parsed URL can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for stdlib →
FAQ
The vulnerability allows for authorization bypasses in certain applications. Attackers can manipulate the Host field of a URL to include arbitrary suffixes that are not recognized by the parsing validation. This can lead to unauthorized access to restricted resources and compromise the security of affected applications.
The vulnerability affects versions 0.0.0 to 1.11.12 and versions 1.12.0-0 to 1.12.7 of the Go stdlib package. It is recommended to upgrade to version 1.11.13 or 1.12.8, or later, to mitigate the vulnerability.
While specific exploits for this vulnerability may not be publicly known, the potential for authorization bypasses can have significant security implications. It is crucial to address this vulnerability promptly by updating the affected package.
Yes, this vulnerability can be exploited remotely. As it affects the parsing validation of URLs, an attacker can craft a malicious URL and send it to a vulnerable application, potentially bypassing authorization mechanisms and gaining unauthorized access to restricted resources.
Yes, if upgrading to a fixed version of the Go stdlib package is not immediately feasible, a workaround involves implementing additional validation checks on the parsed URL. This can involve manually verifying the host field against the expected hostname and port, disregarding any unrecognized suffixes.
References
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.