bug: The JWT bypass matches a cleaned path but forwards the raw path, so /mcp/../healthz skips validation
Maintainer thường phản hồi trong vòng 1 ngày
@evaline-ju đang làm issue này rồi.
Từ ngày 16/11/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Problem
The inbound JWT bypass compares a cleaned path, but the app behind the sidecar gets the raw path. A request with .. segments can match a bypass pattern and then reach a protected handler with no token.
/healthz and /.well-known/* are in bypass.DefaultPatterns (core/bypass/matcher.go:12), so the default config has this problem.
Reproduction (main at 676557d35)
- Cortex side, Go test:
bypass.NewMatcher(bypass.DefaultPatterns).Match("/mcp/../healthz")returnstrue.- A
reverseproxy.NewServerin front of a test backend gets the raw requestPOST /mcp/../healthz HTTP/1.1. The backend seesRequestURI = "/mcp/../healthz", and the status is 200.
- App side: a FastAPI 0.136 app on uvicorn 0.35 with
@app.post("/mcp/{rest:path}").curl --path-as-is -X POST http://127.0.0.1:<port>/mcp/../healthzreturns{"handler":"protected-mcp","rest":"../healthz"}.
Together: the request skips JWT validation as /healthz, and the app runs the protected /mcp handler.
Cause
core/bypass/matcher.go:46:Matchrunspath.Clean(requestPath)before it matches. The repo's own test asserts thatMatch("/foo/../healthz")is true.core/plugins/jwtvalidation/plugin.go:393-398passespctx.Pathto the bypass check. The reverse proxy setspctx.Pathfrom the decodedr.URL.Path(core/listener/reverseproxy/server.go:337). So/mcp/..%2Fhealthzalso decodes to/mcp/../healthz.- The reverse proxy forwards the original path. It has no
ServeMuxthat cleans or redirects the path.
Fix
In Match, return false when path.Clean(p) != p (allow one trailing slash if needed). Then a non-canonical path never bypasses validation. Also match on the escaped path, not the decoded one. Add a test for /mcp/../healthz and /mcp/..%2Fhealthz through jwt-validation.
Impact if not fixed
In sidecar deployments, a caller with no token can reach protected inbound routes on apps that do not normalize .. segments. The laptop install does not use inbound JWT validation. Not checked: frameworks other than FastAPI (Express, Spring). The envoy-sidecar path (ext_proc) was not tested.
- Ngôn ngữ chính
- Go
- Star
- 26
- Fork
- 46
- Merge trung bình
- 9 giờ 55 phút
- Pull request đã merge (30 ngày)
- 257
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rossoctl/cortex
-
bug laptop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug laptop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feat: Do not count a removed session's cost again when an import brings it backCó thể đã có người làm @huang195 đã nhận hôm nay. Đang mởenhancement
rossoctl/cortex#1885 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: One-hour Anthropic cache writes are priced at the 5-minute rate, so spend is 37.5% too lowĐang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug laptop
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rossoctl/cortex
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Containerpak/cpak#93 ·
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
router-for-me/CLIProxyAPI#7607 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ui/ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
myNameArnav/lex#52 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100