WebAssembly / WebAssembly/wabt

Missing Validation for catch_all Instruction

Open
#2,525 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
8.1k
Forks
827
Avg merge
4d 6h
Merged PRs (30d)
18

Description

wasm-interp does not enforce the requirement that a catch block must be associated with a try block.

Test case

program.wasm

program.wasm.txt

Environment
  • OS: Ubuntu 20.04
  • CPU: amd64
  • WABT version: 1.0.36
  • Commands:
./wasm-interp --enable-all --run-export=main ./program.wasm
Actual behavior
No validation error is produced.
Expected Behavior

According to the WebAssembly exception handling proposal, a catch block must be directly associated with a try block. If not, the module should fail validation with an error similar to:

catch block isn't associated to a try

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the wasm-interp entry point and reproduce the issue with program.wasm.txt using the reported --enable-all and --run-export=main command. Trace validation for catch instructions and ensure the supplied module is rejected with an error indicating that the catch block is not associated with a try block.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
compilers, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.