WasmEdge: bug: Missing Subtyping Depth Validation
Summary
WasmEdge does not enforce the subtyping depth limit when compiling WebAssembly modules, which leads to successful execution of modules that should otherwise fail validation due to excessive subtyping depth. This behavior is inconsistent with other engines like V8 and WebKit, which enforce a subtyping depth limit of 64.
Current State
Run the following WebAssembly module:
program.wasm.txt
Observed output:
$ /path/to/wasmedge run --enable-all /path/to/test/program.wasm main
[2025-01-04 14:23:15.820] [warning] GC proposal is enabled, this is experimental.
[2025-01-04 14:23:15.856] [warning] component model is enabled, this is experimental.
1
Expected State
The module should fail validation due to the subtyping depth exceeding 64, aligning with the behavior observed in V8 and WebKit. An appropriate error message should indicate that the type depth exceeds the allowed limit, similar to:
subtype depth for Type section's 64th signature exceeded the limits of 63
Reproduction steps
- Download wasmedge-0.14.1-release.
- Run the command:
./wasmedge run --enable-all ./program.wasm main
Screenshots
Any logs you want to share for showing the specific issue
No response
Components
CLI
WasmEdge Version or Commit you used
0.14.1
Operating system information
Ubuntu 20.04
Hardware Architecture
amd64
Compiler flags and options
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (11 by maintainers)
Commits related to this issue
- fix(validator): enforce subtyping depth limit during validation (#4134) Fixes #3949 Signed-off-by: Karan <karanlokchandani@protonmail.com> — committed to Mu-L/WasmEdge by PhantomInTheWire a year ago
Hi @PhantomInTheWire If you are interested in this issue, just go ahead and submit a new PR for it.
Hi @deveshidwivedi Assigned to you.
Hi @DeeBi9,
Since @harshita9104 is coming first, I will let them make a decision before Wednesday. If I don’t get any response, then I will assign this to you.