RUSTSEC-2026-0386: `AsyncFd::new` and related constructors violate I/O safety
Maintainer thường phản hồi trong vòng 2 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
- 70/100
Hướng nghiên cứu
Trước tiên, hãy kiểm tra dependency Tokio của dự án so với các phạm vi phiên bản đã được vá trong cảnh báo. Xem xét mọi cách sử dụng AsyncFd::new, with_interest, try_new và try_with_interest, sau đó chuyển sang các constructor unsafe được ghi nhận trong tài liệu, nơi có thể bảo đảm quyền sở hữu và vòng đời của descriptor. Công việc hoàn tất khi phiên bản Tokio đã chọn không bị ảnh hưởng và các bài kiểm thử liên quan vượt qua mà không sử dụng descriptor tệp theo cách unsafe.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
| Details | |
|---|---|
| Package | tokio |
| Version | 1.45.1 |
| Warning | unsound |
| URL | https://github.com/tokio-rs/tokio/pull/8587 |
| Patched Versions | >=1.51.6, <1.52.0 OR >=1.53.3 |
| Unaffected Versions | <0.3.2 |
tokio::io::unix::AsyncFd provides safe constructors (new, with_interest, try_new, and try_with_interest) that accept any T: AsRawFd rather than requiring proof of ownership or validity of the file descriptor. Because RawFd implements AsRawFd, safe code can construct an AsyncFd from an arbitrary or closed file descriptor, or close/replace the underlying file descriptor while the AsyncFd is still alive.
This violates I/O safety in two ways:
AsyncFd<T>implementsAsFdfor allT: AsRawFdby callingBorrowedFd::borrow_raw(self.as_raw_fd()), allowing safe code to obtain an arbitraryBorrowedFd<'_>without owning the file descriptor.- Tokio's I/O driver stores a pointer to an internal allocation in the
epoll/kqueueuser data for registered file descriptors. If the underlying file descriptor is duplicated and then closed while anAsyncFdis alive, and the OS reuses that file descriptor number for a another IO resource on the same runtime, dropping the firstAsyncFdderegisters the reused file descriptor number and frees the first while the original file description remains registered inepoll, leading to a use-after-free when a readiness event fires.
Starting in Tokio 1.51.6, 1.53.3, and 1.54.0, AsyncFd::new, AsyncFd::with_interest, AsyncFd::try_new, and AsyncFd::try_with_interest are deprecated in favor of the unsafe constructors AsyncFd::register and AsyncFd::register_with_interest. Callers must ensure that the file descriptor remains valid, open, and unchanged for the lifetime of the AsyncFd.
- Ngôn ngữ chính
- Rust
- Star
- 10
- Fork
- 8
- Merge trung bình
- 11 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 1
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 bitcoindevkit/electrum_streaming_client
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
bitcoindevkit/electrum_streaming_client#56 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
GetTx documentationĐang mởdocumentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
bitcoindevkit/electrum_streaming_client#29 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 18/100
bitcoindevkit/electrum_streaming_client#55 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
RUSTSEC-2026-0221: `event-listener` allows `!Send` tags to cross thread boundaries via `StackSlot`Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 51/100
bitcoindevkit/electrum_streaming_client#54 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
bitcoindevkit/electrum_streaming_client#53 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của bitcoindevkit/electrum_streaming_client
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
farion1231/cc-switch#8829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug ci good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/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 92/100
longbridge/gpui-kit#3677 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
E-pr-welcome
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
seanmonstar/reqwest#3121 · 2 bình luận ·
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 68/100
ilya-zlobintsev/LACT#1235 ·
Maintainer thường phản hồi trong vòng 1 ngày