CVE-2020-15586: Data race and crash in net/http

stdlib Updated 02 Oct 2025

Summary

17/02/2022
Yes i
Unrated
Not published

CVE-2020-15586: Data race and crash in net/http. Affects stdlib across 2 version ranges.

< 1.13.13 >= 1.14.0-0, < 1.14.5

Fixed in 1.13.13 or 1.14.5, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2020-15586 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The stdlib package in the Go ecosystem provides a set of standard libraries for the Go programming language. One of the key packages in the stdlib is net/http, which offers functionality for building HTTP servers and clients. It includes features like request handling, response writing, and routing. However, a vulnerability has been discovered in the net/http package that can lead to a data race and crash in HTTP servers. This vulnerability specifically affects the Handler in HTTP servers where concurrent reading of the request body and writing of a response occurs. The httputil.ReverseProxy Handler is also impacted by this vulnerability.

Vulnerability Detail

The data race and crash vulnerability in net/http can cause HTTP servers to crash when the Handler concurrently reads the request body and writes a response. This can lead to unexpected behavior and denial of service. The vulnerability originates from a race condition in the handling of the request body and response writing. If multiple goroutines access and modify the same data concurrently without proper synchronization, it can result in inconsistent or corrupted state, leading to crashes. The httputil.ReverseProxy Handler is particularly susceptible to this vulnerability.

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.13.13 1.13.13
    go get stdlib@v1.13.13
  • >= 1.14.0-0, < 1.14.5 1.14.5
    go get stdlib@v1.14.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If updating to the fixed version is not immediately feasible, a possible workaround is to avoid concurrent reading of the request body and writing of the response in the affected Handler. This can be achieved by ensuring that the request body is fully read before writing the response. Here is an example of a workaround code snippet:

func handler(w http.ResponseWriter, r *http.Request) {
    body, err := ioutil.ReadAll(r.Body)
    if err != nil {
        // Handle error
    }
    // Process the request body
    // ...
    // Write the response
    w.Write([]byte("Response"))
}

By reading the entire request body before writing the response, the data race condition can be avoided.

Conclusion

The data race and crash vulnerability in net/http can have serious consequences, including server crashes and denial of service. It is crucial to update the affected version of the Go stdlib package to the fixed version (1.14.5 or later) to mitigate the risk. If immediate updating is not possible, implementing the suggested workaround can help prevent the data race condition. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

The vulnerability can cause HTTP servers to crash, leading to denial of service. It can also result in unexpected behavior and potential data corruption.

The vulnerability affects versions 1.14.0-0 to 1.14.5 of the Go stdlib package.

Yes, the vulnerability has been fixed in version 1.14.5 of the Go stdlib package. It is recommended to update to this version or a later one to resolve the issue.

A possible workaround is to ensure that the request body is fully read before writing the response in the affected Handler. This can help avoid the data race condition.

Yes, this vulnerability can be exploited remotely by sending concurrent requests to the affected HTTP server.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

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.13.13 1.13.13
    go get stdlib@v1.13.13
  • >= 1.14.0-0, < 1.14.5 1.14.5
    go get stdlib@v1.14.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback