You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The remote admin API access-control check authorizes requests using a lexical prefix match against the raw request path, without normalizing it first.
RemoteAdmin.enforceAccessControls → adminPathAllowed (admin.go) compares r.URL.Path against each configured allowed path. Because the path is not cleaned first, a request such as:
/pki/ca/prod/../../../../load
Satisfies the prefix check for an identity scoped to /pki/ca/prod, even though it resolves to /load.
Is it exploitable today?
No — and I want to be upfront about that, so this is a hardening proposal rather than a security report. The admin router is http.ServeMux, which normalizes/redirects .. and duplicate-slash paths before dispatch, so the handler for /load is never reached via such a request. I confirmed this against Go 1.25's ServeMux:
/config/../stop → 307 redirect (never dispatches to /stop)
/config/%2e%2e/stop → dispatches to the /config/ handler the caller is
already authorized for
Why fix it anyway
The access-control layer's correctness currently depends on the router's cleaning behavior. If the admin mux were ever swapped for a router that cleans-and-dispatches instead of redirecting (a common pattern; go-chi is already a dependency elsewhere in the tree), this silently becomes a real authorization bypass. Authorization should be self-contained and not rely on a downstream component to sanitize its input.
Proposed solution
Normalize both the request path and the allowed path with path.Clean (purely lexical — no filesystem access, no symlink resolution) before the boundary check. This preserves the existing GHSA-gx7w segment-boundary semantics (e.g. /pki must not match /pkisecret) and makes trailing-slash handling on the allowed path unambiguous.
I have a patch + regression tests ready (traversal out of scope, sibling traversal, collapsed slashes, exact request with trailing slash); the traversal tests fail without the change and pass with it. Happy to open the PR.
Assistance Disclosure
AI used
If AI was used, describe the extent to which it was used.
Claude (Claude Code) assisted with the investigation, the proposed code change, and the tests. I directed the analysis, reviewed every line, and verified the behavior manually (Go 1.25 ServeMux) and via the added automated tests, which I confirmed fail without the fix and pass with it.
I'll work on this hardening: normalize request and allowed paths with path.Clean before the boundary check, and add regression tests for traversal-out-of-scope, sibling prefixes, collapsed slashes, and trailing-slash exact matches.
Looks like this is already addressed on master: adminPathAllowed now path.Clean()s both the request and allowed paths, and admin_test.go already covers traversal / sibling / collapsed-slash cases. Happy to close if maintainers agree.
Thanks @iabdullah215 — agreed this is resolved by the merged PR #7910. I don't have permission to close issues here; could you (or a maintainer) please close #7909?
Activity
adityabagla7 commentedon Sep 3, 2026
I'll work on this hardening: normalize request and allowed paths with path.Clean before the boundary check, and add regression tests for traversal-out-of-scope, sibling prefixes, collapsed slashes, and trailing-slash exact matches.
adityabagla7 commentedon Sep 3, 2026
Looks like this is already addressed on master: adminPathAllowed now path.Clean()s both the request and allowed paths, and admin_test.go already covers traversal / sibling / collapsed-slash cases. Happy to close if maintainers agree.
iabdullah215 commentedon Sep 3, 2026
Dear @adityabagla7 Kindly mark this issue as resolved as the linked PR has been merged.
Thanks
adityabagla7 commentedon Sep 3, 2026
Thanks @iabdullah215 — closing as resolved by the merged PR #7910 (adminPathAllowed now path.Clean()s request and allowed paths).
adityabagla7 commentedon Sep 3, 2026
Thanks @iabdullah215 — agreed this is resolved by the merged PR #7910. I don't have permission to close issues here; could you (or a maintainer) please close #7909?
mohammed90 commentedon Sep 3, 2026
@adityabagla7, shut down your agent.