Anyone in the WebAppSec world is familiar with CORS as a mechanism to specify policy for when javascript is allowed to make API calls to different domains. As WebAssembly ("Wasm" - a binary web language standardized in 2019; webassembly.org, wikipedia/WebAssembly) gains popularity, I'm curious if my CORS:Javascript knowledge transfers over cleanly to CORS:Wasm, or if CORS has different behaviour and "gotchas" with Wasm?
For example, from the Mozilla docs:
- Cross-Origin Resource Sharing (CORS) mentions javascript a bunch of times, but not Wasm.
- From the docs, it seems like CORS applies to the browser APIs XMLHttpRequest and Fetch API, and I'm not expert enough to know if those are javascript APIs and I need to go looking in Wasm API docs for the Wasm equivalents, or if those APIs are low-level enough that they are common to JS and Wasm and therefore Wasm inherits exactly the CORS that I know and love.
'CORS as a mechanism to restrict javascript from making calls to different domains'
- actually, Same Origin Policy (SOP) is what restricts restrict javascript from making calls to different domains. CORS is used to relax SOP, in cases where cross-origin requests are allowed.a mechanism to specify policy for when javascript is allowed to make API calls to different domains
?