C vulnerabilities to WebAssembly

Javier Cabrera Arteaga (javierca@kth.se)

WebAssembly Model Background

WebAssembly - JavaScript model

  • Isolated memory space
  • Direct access to memory
  • No access to JavaScript objects directly

How to create WebAssembly modules?

Vulnerabilities

...with DEMOS

Buffer overflow

DEMO

Function hijacking

  • Function signature based checking ...DEMO
  • function ...DEMO

Format string bug

DEMO
Both contexts: front and backend
Reported in 2018 !!
Flash and Java in the browser

How to prevent it?

Thanks

DEMOS

Taken from Memory safety: old vulnerabilities become new with WebAssembly