Yes, it's supposed to be sandboxed. But
"programs which invoke undefined behavior at the source language level may be compiled into WebAssembly programs which do anything else, including corrupting the contents of the application heap, calling APIs with arbitrary parameters, hanging, trapping, or consuming arbitrary amounts of resources (within the limits)." [1]
So now it's possible to hammer on the entire JavaScript API with invalid parameters. How long before someone finds a hole?