logoalt Hacker News

gavinrayyesterday at 5:30 PM5 repliesview on HN

There is no concept of "executable" vs "non-executable" content in a file.

A file is a bag of bytes. You can send those bytes to different things, like a text editor's content-stream, or as the input to a WASM interpreter.

What you decide to do with the bytes in a file is your own prerogative. Each byte is whatever you make of it.


Replies

jedbergyesterday at 5:34 PM

Sure, but when the standard says "read this file and execute the instructions you find at the beginning" that is more dangerous than "this is a file with data and your program needs to figure out how to read it".

show 1 reply
ratorxyesterday at 5:39 PM

There’s a big difference in the expected use of a file. If the file is attacker provided, and the fallback path is being used, the attacker can embed whatever WASM payload they want into the file since the file will be “opened” by “execute this offset into the file”.

Compare that to JSON. The parser NEVER needs to execute arbitrary instructions. Parser might have bugs, but it avoids a whole class of issues.

show 2 replies
jastantonyesterday at 5:33 PM

gotcha, so the vulnerability will be in some common libraries that attackers force some wasm fallback path with custom wasm instructions that when executed does something nefarious.

I'd say at worst it's setup for poor security

outside1234yesterday at 5:32 PM

I mean can't we say the same thing about sending around a .exe though?

show 3 replies
sieabahlparkyesterday at 5:44 PM

[dead]