CVE-2021-32813: Github.com/traefik/traefik/v2 Header Dropping Vulnerability

MODERATE
Advisory Identifier: GHSA-m697-4v8f-55qg
CVSS 4.8
CWE-913
Published
Advisory Summary

CVE-2021-32813 is a MODERATE (CVSS 4.8) header dropping vulnerability (CWE-913: Improper Control of Dynamically-Managed Code Resources) affecting Github.com/traefik/traefik/v2 libraries in the Go ecosystem. The issue involves header dropping in traefik. Remediation is available by upgrading affected packages to version 2.4.13.

CVE-2021-32813 at a Glance

CVE Identifier CVE-2021-32813
GHSA Identifier GHSA-m697-4v8f-55qg
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-913: Improper Control of Dynamically-Managed Code Resources
Affected Product Github.com/traefik/traefik/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2021-32813

To remediate this vulnerability, upgrade all affected Github.com/traefik/traefik/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/traefik/traefik/v2 fixed: 2.4.13
Upgrade github.com/traefik/traefik/v2 to 2.4.13
github.com/traefik/traefik fixed: Latest secure release
Upgrade github.com/traefik/traefik to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/traefik/traefik/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-32813, inspect your project dependencies for Github.com/traefik/traefik/v2:

inspect dependencies for github.com/traefik/traefik/v2

Analyze the terminal output to locate any version of Github.com/traefik/traefik/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.13), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-913: Improper Control of Dynamically-Managed Code Resources, where the product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. In Github.com/traefik/traefik/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Impact There exists a potential header vulnerability in Traefik's handling of the Connection header. Active exploitation of this issue is unlikely, as it requires that a removed header would lead to a privilege escalation, however, the Traefik team has addressed this issue to prevent any potential abuse. # Details If you have a chain of Traefik middlewares, and one of them sets a request header `Important-Security-Header`, then sending a request with the following Connection header will cause it to be removed before the request was sent: ``` curl 'https://example.com' -H "Connection: Important-Security-Header" -0 ``` In this case, the backend does not see the request header `Important-Security-Header`. # Patches Traefik v2.4.x: https://github.com/traefik/traefik/releases/tag/v2.4.13 # Workarounds No. # For more information If you have any questions or comments about this advisory, [open an issue](https://github.com/traefik/traefik/issues).

CVE-2021-32813 Affected Github.com/traefik/traefik/v2 Versions

2 component(s)
Fixed Versions:
2.4.13
Product / Package Ecosystem Affected Versions Fixed Version
github.com/traefik/traefik/v2
Go
< 2.4.13
2.4.13
github.com/traefik/traefik
Go
≤ 1.7.30

References

Frequently Asked Questions

What is CVE-2021-32813?
CVE-2021-32813 is a security vulnerability in Github.com/traefik/traefik/v2 involving Header dropping in traefik under CWE-913: Improper Control of Dynamically-Managed Code Resources.
Which Github.com/traefik/traefik/v2 versions are affected?
Affected versions include releases prior to 2.4.13 across affected packages: github.com/traefik/traefik/v2, github.com/traefik/traefik.
What version fixes CVE-2021-32813?
Upgrading to 2.4.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/traefik/traefik/v2 affected?
Yes, github.com/traefik/traefik/v2 is affected in releases prior to 2.4.13. Upgrade your dependency to 2.4.13 or later.
Is github.com/traefik/traefik affected?
Yes, github.com/traefik/traefik is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2021-32813?
CVE-2021-32813 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2021-32813?
CVE-2021-32813 is classified under CWE-913: Improper Control of Dynamically-Managed Code Resources (The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.).
How can I check Go dependencies for CVE-2021-32813?
Run the dependency tree command: 'inspect dependencies for github.com/traefik/traefik/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m697-4v8f-55qg",
  "modified" : "2021-08-31T20:57:09Z",
  "published" : "2021-08-05T17:04:21Z",
  "aliases" : [ "CVE-2021-32813" ],
  "summary" : "Header dropping in traefik",
  "details" : "# Impact\n\nThere exists a potential header vulnerability in Traefik's handling of the Connection header. Active exploitation of this issue is unlikely, as it requires that a removed header would lead to a privilege escalation, however, the Traefik team has addressed this issue to prevent any potential abuse.\n\n# Details\n\nIf you have a chain of Traefik middlewares, and one of them sets a request header `Important-Security-Header`, then sending a request with the following Connection header will cause it to be removed before the request was sent:\n\n```\ncurl 'https://example.com' -H \"Connection: Important-Security-Header\" -0\n```\n\nIn this case, the backend does not see the request header `Important-Security-Header`.\n\n# Patches\n\nTraefik v2.4.x: https://github.com/traefik/traefik/releases/tag/v2.4.13\n\n# Workarounds\n\nNo.\n\n# For more information\n\nIf you have any questions or comments about this advisory, [open an issue](https://github.com/traefik/traefik/issues).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.4.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.7.30"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/security/advisories/GHSA-m697-4v8f-55qg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32813"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/pull/8319/commits/cbaf86a93014a969b8accf39301932c17d0d73f9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/releases/tag/v2.4.13"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/traefik/traefik"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-913" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-04T18:54:19Z",
    "nvd_published_at" : "2021-08-03T23:15:00Z"
  }
}