UPLC: Flat decoding accepts a byte string whose filler ends mid-byte
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 79/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend
调研方向
从UPLC.ts中的decodeByteString(第510行)和_skipByte(第461行)开始,然后对照Plutus Decoder/Prim.hs(第443行)中描述的字节边界检查。当填充部分在一个字节中间结束时,让解码抛出UPLCError;验证给定的十六进制输入会被拒绝,同时有效的字节字符串仍能解码。
由索引模型根据 Issue 内容生成。
描述
UPLC.fromFlatHex("01010048a0354001") decodes to the byte string constant aa, and UPLC.toFlatHex writes it back as 010100488101aa0001. Plutus rejects the input.
In those bytes, the type list ends at bit 2 of the byte a0. The filler before the byte string is a single 1 bit, so it ends at bit 3 of that byte, and the chunk length and data that follow start mid-byte. decodeByteString (UPLC.ts:510) calls _skipByte (UPLC.ts:461), which reads bits until a 1 and never checks that it stopped on a byte boundary, then reads the chunks unaligned. Plutus reads the same filler (dFiller, PlutusCore/Flat/Decoder/Strict.hs:301-304) and then fails in getChunksInfo unless the position is byte aligned (Decoder/Prim.hs:443, badEncoding endPtr s "usedBits /= 0", at plutus 1.72.0.0).
Every byte string goes through this path: ByteString, String and Data constants, and with #667 the keys of Value constants. Only hand-made or corrupted input triggers it, and the ledger rejects such a script. The effect is that decoding and re-encoding changes the script bytes, and so its hash, where it should fail.
decodeByteString should throw a UPLCError when the filler does not end on a byte boundary.
- 主要语言
- TypeScript
- 星标
- 22
- 派生
- 35
- 平均合并
- 19 小时 9 分钟
- 30 天内合并 PR
- 65
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
IntersectMBO/evolution-sdk 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
IntersectMBO/evolution-sdk#696 ·
维护者通常 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可能已有人在做 @Kshot3000 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
IntersectMBO/evolution-sdk#518 ·
维护者通常 1 天内回复
-
RewardAccount: validate header type bits and bech32 prefix可能已有人在做 @Kshot3000 于 7 天前认领。 未关闭enhancement external-review
难度 2/5 1-3 小时 新手友好度 84/100
IntersectMBO/evolution-sdk#456 · 1 条评论 ·
维护者通常 1 天内回复
查看 IntersectMBO/evolution-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
kunchenguid/gh-axi#220 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
prerender: wait for env-runner worker readiness before crawling可能已有人在做 @sarankumar1325 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复