Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RUSTSEC-2026-0097: Rand is unsound with a custom logger using `rand::rng()`

オープン
#55 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
rust
領域
backend, security

調査の方向性

Start by reading the linked rand advisory at https://github.com/rust-random/rand/pull/1763 and check how this repository depends on or configures rand. The report describes undefined behavior in rand under specific logger and feature conditions but does not say what change this repository should make. Done is unclear from the issue text alone.

索引モデルが issue の本文から書いたものです。

説明

Details
Package rand
Version 0.8.5
Warning unsound
URL https://github.com/rust-random/rand/pull/1763
Patched Versions >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6
Unaffected Versions <0.7.0
Aliases GHSA-cq8v-f236-94qc

It has been reported (by @lopopolo) that the rand library is unsound (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:

  • The log and thread_rng features are enabled
  • A custom logger is defined
  • The custom logger accesses rand::rng() (previously rand::thread_rng()) and calls any TryRng (previously RngCore) methods on ThreadRng
  • The ThreadRng (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)
  • Trace-level logging is enabled or warn-level logging is enabled and the random source (the getrandom crate) is unable to provide a new seed

TryRng (previously RngCore) methods for ThreadRng use unsafe code to cast *mut BlockRng<ReseedingCore> to &mut BlockRng<ReseedingCore>. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of aliased mutable references is Undefined Behaviour, the behaviour of optimized builds is hard to predict.

主要言語
Rust
スター
10
フォーク
8
平均マージ
11日 12時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bitcoindevkit/electrum_streaming_client のほかの issue

bitcoindevkit/electrum_streaming_client の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。