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

der: ASN.1 REAL (f64) decoder panics on short binary-encoding value (index out of bounds)

オープン 初心者向け
#2,482 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust

調査の方向性

der/src/asn1/real.rs の f64 に対する DecodeValue 実装から始め、報告で説明されているバイナリエンコーディングの分岐を追ってください。0x80 のような 1 バイトの値がどのように処理されるかを確認し、関連する DER REAL デコーダーのテストを実行してください。不正な短い内容がパニックを起こさずエラーを返せば完了です。報告には特定のテストファイル名は記載されていません。

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

説明

Note: this was originally privately disclosed by @tonghuaroot as GHSA-27m6-7r55-vwr2. I am posting it publicly because it's in an off-by-default obscure feature that no one uses, and because we continue to receive duplicate LLM-generated reports about it.

The ASN.1 REAL decoder in the der crate (impl DecodeValue for f64, der/src/asn1/real.rs) validates only a minimum on the value content
length (header.length() == Length::ZERO) and then, for the binary-encoding branch, reads fixed byte offsets (bytes[1], and bytes[2] for the
two-octet exponent form) out of the attacker-controlled value content without confirming the content is long enough to hold the exponent field.

A DER REAL value whose content is the single byte 0x80 reaches bytes[1] on a length-1 slice and triggers an index out of bounds panic
instead of returning Err. Any code that calls f64::from_der / f64::decode (or decodes a struct containing an f64) on untrusted bytes.

I will further add that accepting this feature at all was likely a mistake given the security/crypto-oriented nature of this library. It should probably be removed entirely in the next breaking release.

主要言語
Rust
スター
341
フォーク
193
平均マージ
1日 15時間
マージ済み PR(30日)
21

環境構築

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

はじめの一歩

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

RustCrypto/formats のほかの issue

RustCrypto/formats の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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