Repository navigation
Fix basePath validation for dashboard template - #12729
Merged
Merged
Conversation
mmatur
requested changes
Feb 25, 2026
thaJeztah
reviewed
Feb 25, 2026
| ) | ||
|
|
||
| // Allowed characters in URL following RFC 3986 (https://www.rfc-editor.org/rfc/rfc3986#section-2) | ||
| var validBasePath = regexp.MustCompile(`^/[a-zA-Z0-9/_.-]*$`) |
Contributor
There was a problem hiding this comment.
Only glancing over, but I noticed . in the accepted range; is path traversing allowed? (/api/../../, /api/./foo/); not sure if those are problematic or handled elsewhere; mostly curious!
Member
Author
There was a problem hiding this comment.
Hello @thaJeztah,
The . character is valid in a URL and may legitimately be used by some users when defining their basePath. Additionally, this value can only be set through the static configuration, meaning it is controlled by a Traefik administrator. Given this condition, we think that path traversal is not a concern in this context at the moment 🙂
alexlebens
pushed a commit
to alexlebens/infrastructure
that referenced
this pull request
Mar 6, 2026
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [traefik/traefik](https://github.com/traefik/traefik) | patch | `v3.6.9` → `v3.6.10` | --- ### Release Notes <details> <summary>traefik/traefik (traefik/traefik)</summary> ### [`v3.6.10`](https://github.com/traefik/traefik/blob/HEAD/CHANGELOG.md#v3610-2026-03-06) [Compare Source](traefik/traefik@v3.6.9...v3.6.10) [All Commits](traefik/traefik@v3.6.9...v3.6.10) **Bug fixes:** - **\[docker]** Bump Docker and OpenTelemetry dependencies ([#​12761](traefik/traefik#12761) by [mmatur](https://github.com/mmatur)) - **\[fastproxy]** Bump github.com/valyala/fasthttp to v1.69.0 ([#​12763](traefik/traefik#12763) by [kevinpollet](https://github.com/kevinpollet)) - **\[healthcheck, grpc]** Remove path parsing with grpc healthcheck ([#​12760](traefik/traefik#12760) by [rtribotte](https://github.com/rtribotte)) - **\[k8s/gatewayapi]** Fix Gateway API router's rules ([#​12753](traefik/traefik#12753) by [rtribotte](https://github.com/rtribotte)) - **\[middleware]** Fix HasSecureHeadersDefined returning false when stsSeconds is 0 ([#​12684](traefik/traefik#12684) by [veeceey](https://github.com/veeceey)) - **\[otel]** Bump go.opentelemetry.io/otel dependencies ([#​12754](traefik/traefik#12754) by [rtribotte](https://github.com/rtribotte)) - **\[server]** Bump golang.org/x/net to v0.51.0 ([#​12756](traefik/traefik#12756) by [kevinpollet](https://github.com/kevinpollet)) - **\[webui]** Fix priority display in dashboard and ACME bypass redirect ([#​12740](traefik/traefik#12740) by [mmatur](https://github.com/mmatur)) - **\[webui]** Fix basePath validation for dashboard template ([#​12729](traefik/traefik#12729) by [gndz07](https://github.com/gndz07)) **Documentation:** - **\[middleware]** Correct documentation for Digest auth ([#​12651](traefik/traefik#12651) by [Zash](https://github.com/Zash)) - Add missing `.http` to TOML table names ([#​12713](traefik/traefik#12713) by [Darsstar](https://github.com/Darsstar)) - Fix incorrect TOML example in entrypoints docs ([#​12711](traefik/traefik#12711) by [mfmfuyu](https://github.com/mfmfuyu)) - Fix API basepath option documentation ([#​12744](traefik/traefik#12744) by [nmengin](https://github.com/nmengin)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41MS4wIiwidXBkYXRlZEluVmVyIjoiNDMuNTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiYXV0b21lcmdlIiwiaW1hZ2UiXX0=--> Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/4498 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
2 tasks done
1 task done
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Replace the imported
text/templatewithhtml/templatefor the dashboard template and add validation for thebasePathconfiguration.Motivation
A stricter regex validation will allow user to be warned early if the URL in their
basePathis not a valid URL.text/templateprovides no automatic escaping for HTML or JavaScript contexts. Switching tohtml/templateensures values rendered into the dashboard template are properly escaped, preventing potential injection issues.More