feat: validate onion3 addresses
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust
- Lĩnh vực
- networking
Hướng nghiên cứu
Bắt đầu từ Onion3Addr::from và dependency data-encoding hiện có, sau đó so sánh cách xử lý địa chỉ hiện tại với định dạng Tor v3 được liên kết. Xác định xem việc kiểm tra checksum, version và public key có thuộc về library này hay không, rồi thêm một phép chuyển đổi có thể thất bại cùng các test cho những quy tắc đã chọn. Hoàn thành nghĩa là các địa chỉ onion3 không hợp lệ bị từ chối trước khi đến Tor.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
You can currently create invalid onion3 addresses:
let mut b = [0u8; 35];
OsRng.fill_bytes(&mut b);
let addr = multiaddr::Onion3Addr::from((b, 12345u16));
let invalid = multiaddr!(Onion3(addr));
Resulting in these error logs in tor
Jun 5 10:10:44 thor Tor[692]: Service address "pd6sf3mqkkkfrn4rk5odgcr2j5sn7m523a4tm7pzpuotk2b7rpuhaeym" invalid checksum.
Jun 5 10:10:44 thor Tor[692]: Invalid onion hostname pd6sf3mqkkkfrn4rk5odgcr2j5sn7m523a4tm7pzpuotk2b7rpuhaeym.onion; rejecting
Question: Should we be validating the checksum and/or the public key in this library? Defined as follows:
onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"
CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]
where:
- PUBKEY is the 32 bytes ed25519 master pubkey of the hidden service.
- VERSION is a one byte version field (default value '\x03')
- ".onion checksum" is a constant string
- CHECKSUM is truncated to two bytes before inserting it in onion_address
source: https://github.com/torproject/torspec/blob/main/rend-spec-v3.txt#LL2258C6-L2258C6
This would introduce a number of dependencies: (edit: not required due to existing base32data-encoding dep), sha3 and an ed25519 library if we decided to validate the PUBKEY.
In many cases the user can leave it to tor, but you may not want to e.g. include the address in a database if it is invalid.
I wanted thoughts on if this is in scope for this library or if this validation should be left up to the user.
I'd be happy to work on a PR for this if this is in scope. Changes should be fairly minor: Fallible TryFrom impl, decoding the address and verifying the checksum, version and possibly the ed25519 key, and adding some new tests.
- Ngôn ngữ chính
- Rust
- Star
- 101
- Fork
- 56
- Merge trung bình
- 23 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 multiformats/rust-multiaddr
-
support custom multiaddrĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
multiformats/rust-multiaddr#134 · 1 bình luận ·
-
Mark `/wss` as deprecatedĐang mởdifficulty:easy help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 47/100
multiformats/rust-multiaddr#100 ·
-
Remove `from_url` moduleĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Purpose of Arc in MultiaddrĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
multiformats/rust-multiaddr#90 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của multiformats/rust-multiaddr
Issue tương tự
-
docs(openclaw): RTK_REWRITE_HOST relaxes every default ask, not only commands no rule matchedĐang mởarea:docs documentation good first issue priority:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
rtk-ai/rtk#4500 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage:accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
open-telemetry/otel-arrow#4343 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mishraprafful/multihull#150 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package managerĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
voidzero-dev/vite-plus#2970 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai_p2 comp-parquet-reader-v3
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 66/100
ClickHouse/ClickHouse#124986 ·
Maintainer thường phản hồi trong vòng 1 ngày