Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#2,289 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@rossberg ya está trabajando en esto.

Desde el 21/10/2026.

  • #2294 de @rossberg — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
67/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
wasm

Línea de trabajo

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".

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
WebAssembly
Estrellas
3.5k
Forks
540
Merge medio
1 d 4 h
PR fusionados (30 d)
19

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de WebAssembly/spec

Todos los issues de WebAssembly/spec

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.