der: ASN.1 REAL (f64) decoder panics on short binary-encoding value (index out of bounds)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- cryptography, security
調査の方向性
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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustCrypto/formats のほかの issue
-
IssuingDistributionPoint has the wrong AssociatedOid (id-pe-subjectInfoAccess)対応中かも @eyusd が 72 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
RustCrypto/formats#2389 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
RustCrypto/formats#2366 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
RustCrypto/formats#2471 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RustCrypto/formats#2430 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
RustCrypto/formats#2428 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
RustCrypto/formats の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
521xueweihan/HelloGitHub#4023 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nautechsystems/nautilus_trader#5365 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
IntersectMBO/developer-experience#347 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
registrystack/registry-stack#2168 ·
メンテナーはふだん 1 日以内に返信
-
bug crate: 3d help wanted triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kornia/kornia-rs#1203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信