Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1mdmhqLTRxZmgtcTJobc4AA3ku
Traefik incorrectly processes fragment in the URL, leads to Authorization Bypass
Summary
When a request is sent to Traefik with a URL fragment, Traefik automatically URL encodes and forwards the fragment to the backend server. This violates the RFC because in the origin-form the URL should only contain the absolute path and the query.
When this is combined with another frontend proxy like Nginx, it can be used to bypass frontend proxy URI-based access control
restrictions.
Details
For example, we have this Nginx configuration:
location /admin {
deny all;
return 403;
}
This can be bypassed when the attacker is requesting to /#/../admin
This won’t be vulnerable if the backend server follows the RFC and ignores any characters after the fragment.
However, if Nginx is chained with another reverse proxy which automatically URL encode the character # (Traefik) the URL will become
/%23/../admin
And allow the attacker to completely bypass the Access Restriction from the Nginx Front-End proxy.
Here is a diagram to summarize the attack:
PoC
This is the POC docker I've set up. It contains Nginx, Traefik proxies and a backend server running PHP.
https://drive.google.com/file/d/1vLnA0g7N7ZKhLNmHmuJ4JJjV_J2akNMt/view?usp=sharing
Impact
This allows the attacker to completely bypass the Access Restriction from Front-End proxy.
Permalink: https://github.com/advisories/GHSA-fvhj-4qfh-q2hmJSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1mdmhqLTRxZmgtcTJobc4AA3ku
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 5 months ago
Updated: 5 months ago
CVSS Score: 6.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Identifiers: GHSA-fvhj-4qfh-q2hm, CVE-2023-47106
References:
- https://github.com/traefik/traefik/security/advisories/GHSA-fvhj-4qfh-q2hm
- https://nvd.nist.gov/vuln/detail/CVE-2023-47106
- https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
- https://github.com/traefik/traefik/releases/tag/v2.10.6
- https://github.com/traefik/traefik/releases/tag/v3.0.0-beta5
- https://github.com/advisories/GHSA-fvhj-4qfh-q2hm
Blast Radius: 11.2
Affected Packages
go:github.com/traefik/traefik/v3
Dependent packages: 0Dependent repositories: 2
Downloads:
Affected Version Ranges: < 3.0.0-beta5
Fixed in: 3.0.0-beta5
All affected versions: 3.0.0-beta1, 3.0.0-beta2, 3.0.0-beta3, 3.0.0-beta4
All unaffected versions: 3.0.0
go:github.com/traefik/traefik/v2
Dependent packages: 44Dependent repositories: 52
Downloads:
Affected Version Ranges: < 2.10.6
Fixed in: 2.10.6
All affected versions: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.1.8, 2.1.9, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.10, 2.2.11, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.4.10, 2.4.11, 2.4.12, 2.4.13, 2.4.14, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6, 2.5.7, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.8.7, 2.8.8, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.9.7, 2.9.8, 2.9.9, 2.9.10, 2.10.0, 2.10.1, 2.10.2, 2.10.3, 2.10.4, 2.10.5
All unaffected versions: 2.10.6, 2.10.7, 2.11.0, 2.11.1, 2.11.2