CVE-2021-33197: Vulnerability in stdlib package - Attacker can drop certain headers in net/http/httputil

stdlib Updated 02 Oct 2025

Summary

17/02/2022
Yes i
Unrated
Not published

CVE-2021-33197: Attacker can drop certain headers in net/http/httputil. Affects stdlib across 2 version ranges.

< 1.15.13 >= 1.16.0-0, < 1.16.5

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

Also tracked for

The same CVE-2021-33197 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The stdlib package in the Go ecosystem provides a set of standard libraries for the Go programming language. One of the packages in the stdlib is net/http/httputil, which includes functionality for handling HTTP requests and responses. This vulnerability affects the ReverseProxy component in net/http/httputil. ReverseProxy is used to forward HTTP requests to another server, and it can be configured to include certain hop-by-hop headers in the forwarded request. However, due to a flaw in the implementation, an attacker can exploit this vulnerability to drop arbitrary headers, including those set by the ReverseProxy.Director. This can have serious consequences as it allows an attacker to manipulate the headers sent to the target server, potentially bypassing security measures or causing unexpected behavior.

Vulnerability Detail

The vulnerability (CVE-2021-33197) arises from the ReverseProxy component in net/http/httputil. By exploiting this vulnerability, an attacker can drop certain headers, including the Connection header, when forwarding requests to a target server. This becomes particularly problematic if the target server is also a reverse proxy, as the attacker can then drop arbitrary headers, including those set by the ReverseProxy.Director. This can lead to various security issues, such as bypassing security measures or causing unexpected behavior on the target server. The vulnerability affects versions 0.0.0 to 1.15.13 and 1.16.0-0 to 1.16.5 of the stdlib package in the Go ecosystem.

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.15.13 1.15.13
    go get stdlib@v1.15.13
  • >= 1.16.0-0, < 1.16.5 1.16.5
    go get stdlib@v1.16.5

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

Workaround

As a workaround, developers can manually modify the affected code in the ReverseProxy component to prevent the dropping of headers. One possible approach is to modify the ServeHTTP method in net/http/httputil/ReverseProxy to explicitly include the necessary headers in the forwarded request. Here is an example of how the code can be modified:

func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
  // Add necessary headers
  req.Header.Set("Connection", "keep-alive")

  // Rest of the code...
}

Conclusion

In conclusion, the stdlib package in the Go ecosystem is vulnerable to an issue in the net/http/httputil/ReverseProxy component, which allows an attacker to drop certain headers when forwarding requests. This can have serious security implications, especially if the target server is also a reverse proxy. It is recommended to update the stdlib package to version 1.15.13 or 1.16.5 to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

This vulnerability allows an attacker to drop certain headers, including the Connection header, when forwarding requests to a target server. If the target server is also a reverse proxy, the attacker can drop arbitrary headers, potentially bypassing security measures or causing unexpected behavior.

Versions 0.0.0 to 1.15.13 and 1.16.0-0 to 1.16.5 of the stdlib package in the Go ecosystem are affected by this vulnerability.

To fix this vulnerability, update the stdlib package to version 1.15.13 or 1.16.5, depending on the version being used.

Yes, developers can manually modify the affected code in the ReverseProxy component to prevent the dropping of headers. See the 'workaround' section for more details.

You can find more information about this vulnerability in the Go Vulnerability Database at https://pkg.go.dev/vuln/GO-2021-0241.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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.15.13 1.15.13
    go get stdlib@v1.15.13
  • >= 1.16.0-0, < 1.16.5 1.16.5
    go get stdlib@v1.16.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