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

Second preimage vulnerability in `verify` function

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust

調査の方向性

src/lib.rs の 117-119 行付近にあるリンク先のセクションを読み、ハッシュ関数と検証関数の両方を追跡してください。72 バイトを超える入力がどのように処理されるか、起こり得る panic も含めて確認し、サイズ超過の入力を暗黙的に切り捨てず、エラーを返すことを完了条件としてください。

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

説明

Per #86 and the following link, only the first 72 bytes of the input are considered when generating a hash, leading to hash collisions in the case that inputs are 73 bytes or longer:

https://github.com/Keats/rust-bcrypt/blob/9c9e138/src/lib.rs#L117-L119

(Sidebar: the comment seems to suggest a potential panic when computing a hash for an input longer than 72 bytes, which is a potential DoS vulnerability)

I would suggest returning a Result-based error from both functions in the event the input is longer than 72 bytes.

I'm aware there's some "precedent" with other implementations of bcrypt silently truncating the input to 72 bytes, but I would argue those implementations are similarly vulnerable to second preimage attacks. #86 is a real-world example that this behavior is unexpected.

主要言語
Rust
スター
379
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

環境構築

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

はじめの一歩

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

Keats/rust-bcrypt のほかの issue

Keats/rust-bcrypt の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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