Router allows exec paths hidden behind dot segments (/./exec, /x/../exec)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, go, rust, typescript
- Lĩnh vực
- backend-api-design, security
Hướng nghiên cứu
Read the router implementations and the existing empty segment checks in Go, Rust, and TypeScript, then inspect the spec flags and properties named in the issue. Add the dot segment cases to each router table and mirror the ALLOW_EMPTY_INTERIOR and emptySegmentsHideNoExec coverage. Done means dot segments are denied for every method in all three implementations, with the requested curl --path-as-is integration check passing.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The router allows exec paths hidden behind dot segments. GET /./exec/<id>/json and GET /x/../exec/<id>/json have a first segment of . or x, so the exec check (#49) does not match and the GET passthrough forwards them. This is the same class as the //exec/... bypass fixed for #55 (empty path segment not allowed), which only covers empty segments.
Found in the review of the #55 Task 3 PR. Router-level probe on that branch (Route("GET", path)):
| Path | Go | TS | Rust |
|---|---|---|---|
/./exec/abc/json |
Allow | Allow | Allow (by code reading, not probed) |
/x/../exec/abc/json |
Allow | Allow | Allow (by code reading, not probed) |
/containers/./mycontainer/exec |
Deny (exec) | Deny (exec) | Deny (exec) |
Impact: as with // before #55, a live daemon is expected to answer dot-segment paths with a 301 to the clean path, so nothing should leak. A client that follows the redirect re-enters the proxy on the clean path and is denied. But the router allows an exec path, which the spec's intent forbids, and it depends on daemon behaviour the proxy does not control.
Affected implementation(s)
- All
To Reproduce
- Any policy.
curl --path-as-is --unix-socket proxy.sock 'http://localhost/./exec/<id>/json'- The proxy forwards it (the daemon's answer, not a proxy 403).
Expected behavior
Deny any path with a . or .. segment for every method, right after the empty-segment check, e.g. dot path segment not allowed. Same check in Go, Rust and TS; a spec flag and property mirroring ALLOW_EMPTY_INTERIOR / emptySegmentsHideNoExec (exec path after dot-segment removal ⇒ denied); table rows in all three; an integration check with curl --path-as-is.
Alternatives considered:
- Normalise the path (RFC 3986 remove_dot_segments) and route on the result. Rejected: the proxy would then forward a path different from the one it routed, or have to rewrite it; denying is simpler and the Docker CLI never sends dot segments.
- Rely on the daemon's 301. Rejected for the same reason as #55: the router should not allow an exec path at all.
Environment
- Docker 29.4.0 (OrbStack), branch
fix/empty-segment-head-55.
Additional context
README.md and spec/README.md on that branch say dot segments are not denied yet.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 12 giờ 11 phút
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 ChainSafe/docker-socket-policy
-
Type: Feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
ChainSafe/docker-socket-policy#96 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Priority: P3 Type: Enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
ChainSafe/docker-socket-policy#95 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
ChainSafe/docker-socket-policy#65 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
ChainSafe/docker-socket-policy#46 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ChainSafe/docker-socket-policy
Issue tương tự
-
priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
storytold/photocraft#6759 ·
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 65/100
-
area:logging documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
hugowis/open-fpv-sim#48 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
IngvarConsulting/unica#1537 ·
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 70/100