UPLC: Flat decoding accepts invalid UTF-8 in a string constant and drops a leading BOM
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
UPLC.ts:652 の decodeData から始め、文字列定数の flat デコードテストを読んでください。TextDecoder が不正な UTF-8 と先頭の BOM をどのように扱うかを確認し、デコード時に不正なバイトが拒否され、BOM が保持されることを検証してください。スクリプトのバイト列を変更せずに両方のケースで往復でき、デコーダーのエラーが UPLCError として表面化すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
fromFlatHex accepts a string constant that is not valid UTF-8, and it drops a leading byte order mark (BOM). Both change the script bytes on re-encode.
010000490101ff0001is(program 1.0.0 (con string ...))holding the single byteff. It decodes as"�"and re-encodes to010000490103efbfbd0001. Plutus rejects it with "Input contains invalid UTF-8 data" (dUTF8,plutus-core/flat/src/PlutusCore/Flat/Decoder/Strict.hs:293-299at 1.72.0.0).- The SDK encodes the string
"A"as010000490104efbbbf410001. Decoding those bytes returns"A", so the constant loses a character, and re-encoding gives010000490101410001.
The cause is new TextDecoder().decode(bytes) in decodeData (UPLC.ts:652 on main), which replaces invalid bytes with U+FFFD and strips a BOM. new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }), with its TypeError turned into a UPLCError, matches Plutus.
The ledger rejects such a script, so a transaction carrying one fails before any script runs. The harm is on our side: applyParamsToScript re-encodes the script, so its bytes and hash change without an error. #694 is the same kind of problem for byte strings.
- 主要言語
- TypeScript
- スター
- 22
- フォーク
- 35
- 平均マージ
- 19時間 9分
- マージ済み PR(30日)
- 65
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
IntersectMBO/evolution-sdk のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
IntersectMBO/evolution-sdk#694 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
IntersectMBO/evolution-sdk#559 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
IntersectMBO/evolution-sdk#557 ·
メンテナーはふだん 1 日以内に返信
-
txBuilder: committee cert redeemers are never resolved to a certificate index再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
IntersectMBO/evolution-sdk#518 ·
メンテナーはふだん 1 日以内に返信
-
RewardAccount: validate header type bits and bech32 prefix再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンenhancement external-review
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
IntersectMBO/evolution-sdk#456 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
IntersectMBO/evolution-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openremote/openremote#3487 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
coollabsio/jean#867 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
メンテナーはふだん 1 日以内に返信
-
📘 Docs supabase/cli
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)オープンarea/core kind/bug priority/p2 status/bot-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
google-gemini/gemini-cli#29955 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信