Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[interpreter] Binary decoder rejects heap type indices >= 2^31 as malformed

Đang mở
#2,289 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@rossberg đang làm issue này rồi.

Từ ngày 21/10/2026.

  • #2294 của @rossberg — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
67/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
wasm

Hướng nghiên cứu

Start in interpreter/binary/decode.ml at the s33 decoding path around line 108, then compare how it handles the provided boundary indices 2^31 and 2^31 - 1. Run the interpreter against the included assert_invalid module and check the reported error. Done means 2^31 is decoded as a well-formed index and the module reports "unknown type" rather than "integer representation too long".

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

A heap type index is any non-negative s33:

https://github.com/WebAssembly/spec/blob/340650f2f620169685814774bc5b019d05d4d3d7/specification/wasm-3.0/5.2-binary.types.spectec#L30-L32

So an index of 2^31 or 2^32 - 1 is well-formed, and a module using it is invalid (unknown type), not malformed. The decoder wraps the s33 to a signed 32-bit integer first and reports "integer representation too long":

https://github.com/WebAssembly/spec/blob/340650f2f620169685814774bc5b019d05d4d3d7/interpreter/binary/decode.ml#L108

;; (type (func (param (ref null 2147483648))))
(assert_invalid
  (module binary "\00asm" "\01\00\00\00"
    "\01\0a\01\60\01\63\80\80\80\80\08\00")
  "unknown type")

The interpreter fails this with integer representation too long. Index 2^31 - 1 (\ff\ff\ff\ff\07) is reported as "unknown type" as expected.

Tested at 340650f.

Ngôn ngữ chính
WebAssembly
Star
3.5k
Fork
540
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
19

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WebAssembly/spec

Tất cả issue của WebAssembly/spec

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.