CVE-2024-52003: Github.com/traefik/traefik/v2 Traefik's X-Forwarded-Prefix Header Still Allows Vulnerability

MODERATE
Advisory Identifier: GHSA-h924-8g65-j9wg
CWE-601
Published
Advisory Summary

CVE-2024-52003 is a MODERATE traefik's x-forwarded-prefix header still allows vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/traefik/traefik/v2 libraries in the Go ecosystem. The issue involves traefik's x-forwarded-prefix header still allows for open redirect. Remediation is available by upgrading affected packages to version 2.11.14, 3.2.1.

CVE-2024-52003 at a Glance

CVE Identifier CVE-2024-52003
GHSA Identifier GHSA-h924-8g65-j9wg
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/traefik/traefik/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2024-52003

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.11.14
Upgrade github.com/traefik/traefik/v2 to 2.11.14
github.com/traefik/traefik/v3 fixed: 3.2.1
Upgrade github.com/traefik/traefik/v3 to 3.2.1
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-2024-52003, 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.11.14), 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/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 is a vulnerability in Traefik that allows the client to provide the `X-Forwarded-Prefix` header from an untrusted source. ### Patches - https://github.com/traefik/traefik/releases/tag/v2.11.14 - https://github.com/traefik/traefik/releases/tag/v3.2.1 ### Workarounds No workaround. ### For more information If you have any questions or comments about this advisory, please [open an issue](https://github.com/traefik/traefik/issues). <details> <summary>Original Description</summary> ### Summary The previously reported open redirect ([GHSA-6qq8-5wq3-86rp](https://github.com/traefik/traefik/security/advisories/GHSA-6qq8-5wq3-86rp)) is not fixed correctly. The safePrefix function can be tricked to return an absolute URL. ### Details The Traefik API [dashboard component](https://github.com/traefik/traefik/blob/master/pkg/api/dashboard/dashboard.go) tries to validate that the value of the header X-Forwarded-Prefix is a site relative path: ```go http.Redirect(resp, req, safePrefix(req)+"/dashboard/", http.StatusFound) ``` ```go func safePrefix(req *http.Request) string { prefix := req.Header.Get("X-Forwarded-Prefix") if prefix == "" { return "" } parse, err := url.Parse(prefix) if err != nil { return "" } return parse.Path } ``` ### PoC An attacker can bypass this by sending the following payload: ```bash curl -v 'http://traefik.localhost' -H 'X-Forwarded-Prefix: %0d//a.com' [...] > HTTP/1.1 302 Found > Location: //a.com/dashboard/ ``` or similar: ```bash curl -v 'http://traefik.localhost' -H 'X-Forwarded-Prefix: %2f%2fa.com' [...] > HTTP/1.1 302 Found > Location: //a.com/dashboard/ ``` ### Impact Similar to the previously reported bug. In cache poisoning scenarios this may be exploitable. </details>

CVE-2024-52003 Affected Github.com/traefik/traefik/v2 Versions

2 component(s)
Fixed Versions:
2.11.143.2.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/traefik/traefik/v2
Go
< 2.11.14
2.11.14
github.com/traefik/traefik/v3
Go
< 3.2.1
3.2.1

References

Frequently Asked Questions

What is CVE-2024-52003?
CVE-2024-52003 is a security vulnerability in Github.com/traefik/traefik/v2 involving Traefik's X-Forwarded-Prefix Header still allows for Open Redirect under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/traefik/traefik/v2 versions are affected?
Affected versions include releases prior to 2.11.14, 3.2.1 across affected packages: github.com/traefik/traefik/v2, github.com/traefik/traefik/v3.
What version fixes CVE-2024-52003?
Upgrading to 2.11.14, 3.2.1 (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.11.14. Upgrade your dependency to 2.11.14 or later.
Is github.com/traefik/traefik/v3 affected?
Yes, github.com/traefik/traefik/v3 is affected in releases prior to 3.2.1. Upgrade your dependency to 3.2.1 or later.
What CWE is associated with CVE-2024-52003?
CVE-2024-52003 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-2024-52003?
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-h924-8g65-j9wg",
  "modified" : "2025-11-27T08:05:26Z",
  "published" : "2024-12-02T17:12:38Z",
  "aliases" : [ "CVE-2024-52003" ],
  "summary" : "Traefik's X-Forwarded-Prefix Header still allows for Open Redirect",
  "details" : "### Impact\n\nThere is a vulnerability in Traefik that allows the client to provide the `X-Forwarded-Prefix` header from an untrusted source.\n\n### Patches\n\n- https://github.com/traefik/traefik/releases/tag/v2.11.14\n- https://github.com/traefik/traefik/releases/tag/v3.2.1\n\n### Workarounds\n\nNo workaround.\n\n### For more information\n\nIf you have any questions or comments about this advisory, please [open an issue](https://github.com/traefik/traefik/issues).\n\n<details>\n<summary>Original Description</summary>\n### Summary\nThe previously reported open redirect ([GHSA-6qq8-5wq3-86rp](https://github.com/traefik/traefik/security/advisories/GHSA-6qq8-5wq3-86rp)) is not fixed correctly. The safePrefix function can be tricked to return an absolute URL.\n\n\n\n### Details\nThe Traefik API [dashboard component](https://github.com/traefik/traefik/blob/master/pkg/api/dashboard/dashboard.go) tries to validate that the value of the header X-Forwarded-Prefix is a site relative path:\n```go\nhttp.Redirect(resp, req, safePrefix(req)+\"/dashboard/\", http.StatusFound)\n```\n\n```go\nfunc safePrefix(req *http.Request) string {\n\tprefix := req.Header.Get(\"X-Forwarded-Prefix\")\n\tif prefix == \"\" {\n\t\treturn \"\"\n\t}\n\n\tparse, err := url.Parse(prefix)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn parse.Path\n}\n```\n\n### PoC\nAn attacker can bypass this by sending the following payload:\n\n```bash\ncurl -v 'http://traefik.localhost' -H 'X-Forwarded-Prefix: %0d//a.com'\n[...]\n> HTTP/1.1 302 Found\n> Location: //a.com/dashboard/\n```\n\nor similar:\n\n```bash\ncurl -v 'http://traefik.localhost' -H 'X-Forwarded-Prefix: %2f%2fa.com'\n[...]\n> HTTP/1.1 302 Found\n> Location: //a.com/dashboard/\n```\n\n### Impact\nSimilar to the previously reported bug. In cache poisoning scenarios this may be exploitable.\n</details>",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.11.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/security/advisories/GHSA-h924-8g65-j9wg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52003"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/pull/11253"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/traefik/traefik"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/releases/tag/v2.11.14"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/releases/tag/v3.2.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-02T17:12:38Z",
    "nvd_published_at" : "2024-11-29T19:15:08Z"
  }
}