hyper-util: SOCKS5 connector sends a bracketed IPv6 literal as a domain name
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/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ệ
- rust
- Lĩnh vực
- networking
Hướng nghiên cứu
Bắt đầu tại src/client/legacy/connect/proxy/socks/v5/mod.rs và kiểm tra cách host đích được phân tích thành địa chỉ SOCKS5. Thực hiện một yêu cầu SocksV5 tới https://[::1]:443, sau đó xác minh rằng yêu cầu được mã hóa sử dụng ATYP 0x04 với 16 byte IPv6 thô, thay vì ATYP 0x03 với văn bản có dấu ngoặc vuông.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
My Claude discovered this.
Fable:
Affects hyper-util 0.1.20 (src/client/legacy/connect/proxy/socks/v5/mod.rs), seen through reqwest 0.13.5 with a socks5:// proxy (local DNS mode).
What happens
reqwest resolves the target locally and builds the destination URI with the address; an IPv6 address is written in brackets, as a URI requires (https://[2606:4700::6810:102]:443). SocksV5 then takes dst.host(), which for an IPv6 authority still carries the brackets ([2606:4700::6810:102]), and does:
let address = match host.parse::<IpAddr>() {
Ok(ip) => Address::Socket(SocketAddr::new(ip, port)),
Err(_) => ... Address::Domain(host, port)
"[2606:4700::6810:102]".parse::<IpAddr>() fails, so the literal goes out as ATYP 0x03 (domain name) with the brackets in the string. A SOCKS5 server that joins host and port (tailscaled's does, with Go's net.JoinHostPort) ends up with [[2606:4700::6810:102]]:443 and fails with "missing port in address". IPv4 literals have no brackets, so they parse and go out as ATYP 0x01.
Fix
Strip the URI brackets before parsing the host as an IP address, so an IPv6 literal goes out as ATYP 0x04:
- let address = match host.parse::<IpAddr>() {
+ let bare = host.strip_prefix('[').and_then(|h| h.strip_suffix(']')).unwrap_or(&host);
+ let address = match bare.parse::<IpAddr>() {
Ok(ip) => Address::Socket(SocketAddr::new(ip, port)),
A test: a SocksV5 request to https://[::1]:443 must encode ATYP 0x04 with the 16 raw bytes, not ATYP 0x03 with the text [::1].
How it showed up
A Rust server fetching pages through a Tailscale exit node (tailscaled --socks5-server) with reqwest::Proxy::all("socks5://…") and a custom resolver: every host with an AAAA record failed with error sending request (cause: the proxy's "missing port in address"), and hosts with only A records worked. Ordering the resolver's answers IPv4-first works around it.
- Ngôn ngữ chính
- Rust
- Star
- 16.3k
- Fork
- 1.8k
- Merge trung bình
- 2 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 12
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 hyperium/hyper
-
Publicly reexport the http crateĐang mởC-feature
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
hyperium/hyper#2652 · 4 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 3 ngày
-
C-feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
hyperium/hyper#4186 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
HTTP/1 client connection is never closed or pooled when a response completes while the request body is still unsent ((Reading::KeepAlive, Writing::Body) is a terminal state)Có thể đã có người làm @BlackRabbitCoder đã nhận 13 ngày trước. Đang mởC-bug S-waiting-on-author
hyperium/hyper#4176 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
`Change graceful_shutdown function behavior` PR can cause tonic servers to hang `serve_with_incoming_shutdown` in two different casesCó thể làm lại được @seanmonstar đã nhận 31 ngày trước và không có pull request nào đang mở. Đang mởA-http2 C-bug
hyperium/hyper#4170 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của hyperium/hyper
Issue tương tự
-
`categorize_command` has no `uv` arm, so every `rtk uv …` row counts as `other` in the ecosystem mixĐang mởarea:api bug good first issue priority:low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
rtk-ai/rtk#4316 · 1 bình luận ·
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 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/cli kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
good first issue open-endedness: low type: new feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100