Vulnerabilities in pkg:golang/github.com/containous/traefik/v2/pkg/api

PACKAGE
Advisory Identifier: GHSA-6qq8-5wq3-86rp
Advisory Summary

CVE-2020-15129 is a MODERATE (CVSS 6.1) traefik vulnerable to open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/traefik/traefik libraries in the Go ecosystem. The issue involves traefik vulnerable to open redirect via handling of x-forwarded-prefix header. Remediation is available by upgrading affected packages to version 1.7.26, 2.3.0-rc6, 2.2.8, 2.3.0-rc3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/containous/traefik/v2/pkg/api

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/containous/traefik/v2/pkg/api. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6qq8-5wq3-86rp CVE-2020-15129 MODERATE Traefik vulnerable to Open Redirect via handling of X-Forwarded-Prefix header

CVE-2020-15129 at a Glance

CVE Identifier CVE-2020-15129
GHSA Identifier GHSA-6qq8-5wq3-86rp
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/traefik/traefik
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

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:R/S:C/C:N/I:H/A:N).

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

How to Fix CVE-2020-15129

To remediate this vulnerability, upgrade all affected Github.com/traefik/traefik 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 fixed: 1.7.26
Upgrade github.com/traefik/traefik to 1.7.26
github.com/traefik/traefik/v2 fixed: 2.3.0-rc6
Upgrade github.com/traefik/traefik/v2 to 2.3.0-rc6
github.com/containous/traefik fixed: 1.7.26
Upgrade github.com/containous/traefik to 1.7.26
github.com/containous/traefik/v2 fixed: 2.2.8
Upgrade github.com/containous/traefik/v2 to 2.2.8
github.com/traefik/traefik/v2 fixed: 2.3.0-rc6
Upgrade github.com/traefik/traefik/v2 to 2.3.0-rc6
github.com/containous/traefik/v2 fixed: 2.3.0-rc3
Upgrade github.com/containous/traefik/v2 to 2.3.0-rc3
github.com/traefik/traefik/api fixed: 1.7.26
Upgrade github.com/traefik/traefik/api to 1.7.26
github.com/traefik/traefik/v2/pkg/api fixed: 2.3.0-rc6
Upgrade github.com/traefik/traefik/v2/pkg/api to 2.3.0-rc6
github.com/traefik/traefik/v2/pkg/api fixed: 2.3.0-rc6
Upgrade github.com/traefik/traefik/v2/pkg/api to 2.3.0-rc6
github.com/containous/traefik/api fixed: 1.7.26
Upgrade github.com/containous/traefik/api to 1.7.26
github.com/containous/traefik/v2/pkg/api fixed: 2.2.8
Upgrade github.com/containous/traefik/v2/pkg/api to 2.2.8
github.com/containous/traefik/v2/pkg/api fixed: 2.3.0-rc3
Upgrade github.com/containous/traefik/v2/pkg/api to 2.3.0-rc3
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

How to Check if You Are Affected

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

inspect dependencies for github.com/traefik/traefik

Analyze the terminal output to locate any version of Github.com/traefik/traefik in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.26), 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Github.com/traefik/traefik, 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

## Summary There exists a potential open redirect vulnerability in Traefik's handling of the `X-Forwarded-Prefix` header. Active Exploitation of this issue is unlikely as it would require active header injection, however the Traefik team addressed this issue nonetheless to prevent abuse in e.g. cache poisoning scenarios. ## Details The Traefik API dashboard component doesn't validate that the value of the header `X-Forwarded-Prefix` is a site relative path and will redirect to any header provided URI. e.g. ``` $ curl --header 'Host:traefik.localhost' --header 'X-Forwarded-Prefix:https://example.org' 'http://localhost:8081' <a href="https://example.org/dashboard/">Found</a>.` ``` ### Impact A successful exploitation of an open redirect can be used to entice victims to disclose sensitive information. ### Workarounds By using the `headers` middleware, the request header `X-Forwarded-Prefix` value can be overridden by the value `.` (dot) - https://docs.traefik.io/v2.2/middlewares/headers/#customrequestheaders - https://docs.traefik.io/v1.7/basics/#custom-headers ### For more information If you have any questions or comments about this advisory, open an issue in [Traefik](https://github.com/containous/traefik/issues). ## Credit This issue was found by the GitHub Application Security Team and reported on behalf of the GHAS by the GitHub Security Lab Team.

CVE-2020-15129 Affected Github.com/traefik/traefik Versions

12 component(s)
Fixed Versions:
1.7.262.3.0-rc62.2.82.3.0-rc3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/traefik/traefik
Go
≥ 1.5.0-rc5
< 1.7.26
1.7.26
github.com/traefik/traefik/v2
Go
< 2.3.0-rc6
2.3.0-rc6
github.com/containous/traefik
Go
≥ 1.5.0-rc5
< 1.7.26
1.7.26
github.com/containous/traefik/v2
Go
< 2.2.8
2.2.8
github.com/traefik/traefik/v2
Go
≥ 2.3.0-rc1
< 2.3.0-rc6
2.3.0-rc6
github.com/containous/traefik/v2
Go
≥ 2.3.0-rc1
< 2.3.0-rc3
2.3.0-rc3
github.com/traefik/traefik/api
Go
≥ 1.5.0-rc5
< 1.7.26
1.7.26
github.com/traefik/traefik/v2/pkg/api
Go
< 2.3.0-rc6
2.3.0-rc6
github.com/traefik/traefik/v2/pkg/api
Go
≥ 2.3.0-rc1
< 2.3.0-rc6
2.3.0-rc6
github.com/containous/traefik/api
Go
≥ 1.5.0-rc5
< 1.7.26
1.7.26
github.com/containous/traefik/v2/pkg/api
Go
< 2.2.8
2.2.8
github.com/containous/traefik/v2/pkg/api
Go
≥ 2.3.0-rc1
< 2.3.0-rc3
2.3.0-rc3

References

Frequently Asked Questions

What is CVE-2020-15129?
CVE-2020-15129 is a security vulnerability in Github.com/traefik/traefik involving Traefik vulnerable to Open Redirect via handling of X-Forwarded-Prefix header under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/traefik/traefik versions are affected?
Affected versions include releases prior to 1.7.26, 2.3.0-rc6, 2.2.8, 2.3.0-rc3 across affected packages: github.com/traefik/traefik, github.com/traefik/traefik/v2, github.com/containous/traefik, github.com/containous/traefik/v2, github.com/traefik/traefik/api, github.com/traefik/traefik/v2/pkg/api, github.com/containous/traefik/api, github.com/containous/traefik/v2/pkg/api.
What version fixes CVE-2020-15129?
Upgrading to 1.7.26, 2.3.0-rc6, 2.2.8, 2.3.0-rc3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/traefik/traefik affected?
Yes, github.com/traefik/traefik is affected in releases prior to 1.7.26. Upgrade your dependency to 1.7.26 or later.
Is github.com/traefik/traefik/v2 affected?
Yes, github.com/traefik/traefik/v2 is affected in releases prior to 2.3.0-rc6. Upgrade your dependency to 2.3.0-rc6 or later.
What is the CVSS score of CVE-2020-15129?
CVE-2020-15129 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N.
What CWE is associated with CVE-2020-15129?
CVE-2020-15129 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Go dependencies for CVE-2020-15129?
Run the dependency tree command: 'inspect dependencies for github.com/traefik/traefik'. 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-6qq8-5wq3-86rp",
  "modified" : "2022-08-04T20:56:21Z",
  "published" : "2022-02-11T23:19:21Z",
  "aliases" : [ "CVE-2020-15129" ],
  "summary" : "Traefik vulnerable to Open Redirect via handling of X-Forwarded-Prefix header",
  "details" : "## Summary\n\nThere exists a potential open redirect vulnerability in Traefik's handling of the `X-Forwarded-Prefix` header. Active Exploitation of this issue is unlikely as it would require active header injection, however the Traefik team addressed this issue nonetheless to prevent abuse in e.g. cache poisoning scenarios.\n\n## Details\n\nThe Traefik API dashboard component doesn't validate that the value of the header `X-Forwarded-Prefix` is a site relative path and will redirect to any header provided URI.\n\ne.g.\n\n```\n$ curl --header 'Host:traefik.localhost' --header 'X-Forwarded-Prefix:https://example.org' 'http://localhost:8081'\n<a href=\"https://example.org/dashboard/\">Found</a>.`\n```\n\n### Impact\nA successful exploitation of an open redirect can be used to entice victims to disclose sensitive information.\n\n### Workarounds\n\nBy using the `headers` middleware, the request header `X-Forwarded-Prefix` value can be overridden by the value `.` (dot)\n\n- https://docs.traefik.io/v2.2/middlewares/headers/#customrequestheaders\n- https://docs.traefik.io/v1.7/basics/#custom-headers\n\n### For more information\n\nIf you have any questions or comments about this advisory, open an issue in [Traefik](https://github.com/containous/traefik/issues).\n\n## Credit\n\nThis issue was found by the GitHub Application Security Team and reported on behalf of the GHAS by the GitHub Security Lab Team.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0-rc5"
      }, {
        "fixed" : "1.7.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.0-rc6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 2.2.8"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containous/traefik"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0-rc5"
      }, {
        "fixed" : "1.7.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containous/traefik/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0-rc1"
      }, {
        "fixed" : "2.3.0-rc6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 2.3.0-rc3"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containous/traefik/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0-rc1"
      }, {
        "fixed" : "2.3.0-rc3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0-rc5"
      }, {
        "fixed" : "1.7.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v2/pkg/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.0-rc6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 2.2.8"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v2/pkg/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0-rc1"
      }, {
        "fixed" : "2.3.0-rc6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 2.3.0-rc3"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containous/traefik/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0-rc5"
      }, {
        "fixed" : "1.7.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containous/traefik/v2/pkg/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containous/traefik/v2/pkg/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0-rc1"
      }, {
        "fixed" : "2.3.0-rc3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/containous/traefik/security/advisories/GHSA-6qq8-5wq3-86rp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15129"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containous/traefik/pull/7109"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containous/traefik/commit/cfa04c300c5db95ae8a52c31a9d973b6dd9c2254"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containous/traefik/commit/e63db782c11c7b8bfce30be4c902e7ef8f9f33d2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/commit/e2c5f3712f68993de8ed3cb30da9ec0aa11acb09"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containous/traefik/releases/tag/v1.7.26"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containous/traefik/releases/tag/v2.2.8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containous/traefik/releases/tag/v2.3.0-rc3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/traefik/traefik"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-24T18:21:00Z",
    "nvd_published_at" : "2020-07-30T16:15:00Z"
  }
}