The connection to this talk is that they demo triggering a backdoor hidden in microcode by executing some WebAssembly code in an up-to-date FireFox.
The connection to this talk is that they demo triggering a backdoor hidden in microcode by executing some WebAssembly code in an up-to-date FireFox.
Exploiting HTML or font rendering is more work, but as you still run known instructions in a known sequence processing known data the primitives are still there. The same can happen for anything that processes foreign data, be it script, video, images or just CSV.
I see your point. However, if it's harder for the attacker, it is already a win. Also, this is just one example where JavaScript/WebAssembly are used to deliver/activate malware. There are many other examples.
Besides that, even if JavaScript/WebAssembly implementations were provably secure (which they aren't), I would be against them for the other reasons I described in other comments here.
It is because WASM does not allow self-modifying code, which is a highly effective obfuscation technique as it can hinder static analysis. On the other hand, JavaScript has eval among other things that can be used to dynamically craft and execute code during execution. I've never seen such JavaScript but it would be quite cumbersome to trace code within a call to eval within a call to eval, and so on. You might need to build a custom V8 to record strings passed to eval when reversing such code.
These are three reasons why developing and supporting WebAssembly is finally against the interest of the users.
The harder, less efficient and cumbersome this type of drive-by code deployment is, the less attractive and used it'll be.
Also, sandboxing helps only until it doesn't. It's a futile task, especially when we don't have complete control of the hardware, which we don't, because the chip developers don't tell us complete specificiations and functionality.
> Also, sandboxing helps only until it doesn't. It's a futile task,
It really isn't futile. How many major security holes in Chrome's sandbox have actually done serious damage? Yes, they happen from time to time, but not that often, and they are automatically patched shortly after (or before) disclosure, making them really uninteresting for attackers to try to exploit.
Realistically, the biggest security threat to real users is phishing or similar deception. Many users can be fooled by a page that looks like an error from their operating system telling them that their computer has a virus and they should download a tool to fix it. You don't need JavaScript for that.
Realistically, the highest-impact non-user-error security problems are logic flaws in complicated server code that never intended to run attacker-supplied code in the first place. Think SQL injection, confused deputies, missing access control checks, buffer overruns, SMB (Windows file sharing) bugs exploited by worms, etc.
Ironically, modern JavaScript sandboxing is so good -- with so much careful scrutiny by really smart security researchers -- that realistically it's not remotely the easiest target on your system these days. The easy targets are the software that isn't written with security in mind, and the users themselves (phishing).
> especially when we don't have complete control of the hardware, which we don't, because the chip developers don't tell us complete specificiations and functionality.
JavaScript and WebAssembly don't have direct access to hardware. WebAssembly is not assembly, it's a platform-neutral bytecode that gets recompiled for the host after download.
Regardless, it’s a trade off. Although I agree we should have a web that doesn’t need JavaScript to function - I believe that is a separate argument - I think in this case, while we already have it, I’ll take WebAssembly for the speed and new applications it helps support.
I certainly wouldn’t want to see “Web Assembly” blobs in my browser that I’m not allowed to inspect, which again is another argument, IMO.
This argument has been rehashed over and over again. Some of the mass appeal of the web, as a platform, is that random arbitrary code can be downloaded and run inside a sandbox. It appears that these web technologies will continue to be used regardless of any security implications.
If users demand something like JavaScript or WebAssembly, do you have an alternative proposal to satisfy them?
Users don't demand JavaScript nor WebAssembly, some developers do. Users want to easily discover new programs/games/whatever. If they were presented those equally easy and convenient in another form, they wouldn't even care.
Those developers that demand JavaScript and WebAssembly have mostly interests that go against the interests of the users. The developers might want to hide parts of their code or underlying data from the user, or force presentation in a certain form (ads), or avoid the orderly way of delivering software through proven ways like distributions, possibly to achieve the former two goals.
Now, where does Mozilla stand in this conflict? I realize they don't stand where I thought they would stand.
I want the web, but without random drive-by code execution. Code must be delivered by other, more accounted for ways.
This is stating the obvious, but...
For anything even mildly interactive, JavaScript is absolutely essential to creating a good (or even bearable) user experience. With purely static HTML, every interaction requires a page reload, which is painful. Users absolutely do want modern, low-latency UX.
Moreover, you literally cannot build things like Slack or Google Docs without JavaScript. Users want these products. HTML-only GMail is barely possible but it's really painful to use. Users want GMail with JavaScript.
Maybe you don't want these things. Maybe you are happy with pure-HTML interfaces, or doing anything interactive through dedicated native apps. But there are very few people who prefer it that way. Please don't presume to speak for all users, or accuse Mozilla of working against users, when it's your specific needs that are unusual.
I agree that HTML-only GMail in the browser right now is a mess, but that's because a browser is not an e-mail client, and shouldn't be one.
People are trained for certain behaviours and often don't want to change from that. On the other hand they like new shiney software and things to try out. That explains in my eyes why for example Google Docs (seriously, office editing in the browser?!) is used. Also, Google has a good reputation for software.
I think most people are simply not aware of the dangers, downsides and alternatives of this approach. The behaviour was learned when people talking about a globally snooping NSA were called crackpots.
On top of that, Google has no business interest in offering a standalone office solution, so people either use Google Docs in their browser, or not at all. Supply creates its own demands.
How discoverability and ease of obtaining trusted code is solved, is a technical problem. I could imagine markup-only webpages which can call locally installed programs to appear in the tab, but the prorams are installed in trusted ways. That's just one spontaneous idea.
Mozilla is making it easier for people to use technical solutions that are suboptimal for them. This has a network effect and shapes the web to be a worse place. That is what I accuse Mozilla of, and I stand by it.
HTML is capable of very specific, fixed functions. Sure, video is one of them. But video is not very interactive. You press play, and then you watch. Interactivity in plain HTML is very difficult.
> People are trained for certain behaviours and often don't want to change from that. On the other hand they like new shiney software and things to try out.
No no. People don't use these products because they were "trained" for it. The world of installed native applications existed before the web. The web took off because it's actually way better for many people. Not having to manage installing apps is awesome. Being able to access your data from multiple devices trivially is awesome. Not having to worry about backups is awesome. Being able to collaborate in real time is awesome. People don't just like this stuff because it's "shiney", they like it because it's really, genuinely useful.
> I could imagine markup-only webpages which can call locally installed programs to appear in the tab, but the prorams are installed in trusted ways.
That would actually be way less secure, because those locally-installed programs are almost certainly not security reviewed to the extent that the JavaScript sandbox is. They are far more likely to have exploitable bugs than your JavaScript sandbox. It doesn't matter that you "trust" them.
In practice, the vast majority of programmers do not know how to write secure code. We can't realistically fix that. The answer is to give them programming environments where they can't get it wrong, or at least they can only hurt their own app. We accomplish that with sandboxing.
That the local and native programs are not as good as the browser-based abominations is no argument for that technology; there are reasons for the businesses to choose this way despite (or because) how bad it is for users.
Code that comes for example from a distribution is signed and maintained by someone I can easily identify. It is looked at by more than the author. I can track the path of the code backwards, if something nefarious happens. That justifies trust in that code.
The comparison of that code with the JavaScript sandbox is invalid, it's to be compared with the delivered JavaScript. There is no reason why even trustably delivered code shouldn't be sandboxed. The comparison of that sandbox with the JavaScript sandbox would be apt.
I agree that sandboxing is important, even for local programs.
But you're still in denial about the fact that web app delivery is hugely valuable to a lot of people (yes, to users). This isn't even remotely debatable. SaaS is now a $100B/yr industry and growing rapidly. People wouldn't be rapidly replacing locally-installed apps with SaaS if they didn't really want it.
You really can't just proclaim that everyone should give all that up based on your ideology about how software "should" be delivered.
The size of the market is no argument. Supply drives demand.
I don't simply proclaim how things should be done. I point out problems, criticize the status quo based on sound facts, and point to better solutions. What else do you suggest?
There's no shortage of supply of desktop apps, yet web apps are gaining ground rapidly. This indicates that people prefer web apps for some reason.
> What else do you suggest?
Build it. If you truly have a solution that is better for users, then you can make a lot of money if you bring it to market. Then you not only prove you were right, but you make the world a better place and get rich in the process. :)
But somehow you're going to need to make desktop apps significantly better than they are today. You won't win by telling users that their preferences are wrong, you win by giving them something better.
In those cases, it's certainly easier to use javascript, though.
In the meantime, before they deliver "non-programmable HTML6", they deliver HTML 5.2 (or was it .3?) with DRM inside. Mozilla? They produced buggy, resource-hungry browser for decade (was less resource-hungry than competition, now the same). What to expect from them? These Xmas time, when opening a new empty browser page, they show an ad phishing me for money. And that's exactly what everyone expects from them.
The stories about HTML with DRM and unsolicited adds from Mozilla were discussed here on HN. So again, no idea what tinfoil hat you wear, but godspeed with keeping it up.
Exactly. One of the biggest use-cases I see for JS/Wasm is in implementing DRM obfuscation and more insidious advertising/tracking code.
So, are your concerns about side channel attacks? Side channels are nothing more than undocumented (and sometimes unfixable) logical features. Opening the microcode for inspection and making it patchable will only reduce the number of undocumented features.
With that in mind, what realistically is possible to do, over than to declare that everything can only be read as plain text (and hope there's no exploitable bugs in font rendering of system fonts)?
Also, JavaScript and WebAssembly (the latest starting with this talk) are actively used for unauthorized access to computers. It's not like I'm pointing out theoretical attack possibilities. This makes the matter more urgent.
JS does provide some very valid use-cases, and two of them that come to mind are interactivity and displaying static data that has no neat representation in HTML (e.g., Mathjax and d3.js for charting).
My point is that JS is far from the only massive, complex, potentially security-laden hole in a modern web browser. Audio/video codecs are notoriously complex, and font rendering also has this nasty habit of causing kernel crashes on Windows. These have been used for active exploits. The way you achieve security is you have to look at the risks and work out ways to mitigate them. There are ways to be quite secure even allowing JS execution.
Giving an attacker a JIT makes it easier for them to lay out memory with the NX bit set to zero (executable memory) that they can later jump into.
Return-oriented programming can still be used to hijack a program that whose executable parts are locked down at runtime, having a JIT just makes things easier.
(The latter is an annoyance, BTW: there's no reason to treat Java bytecode, say, differently from PROT_EXEC pages. Executable protection should have nothing to do with active or inactive list membership.)
Mozilla's decisions speak for themselves. There is no need to reference individuals, and less so without very solid basis (which there wasn't).
This is absolutely not true if you have a MMU and something like a protection ring. In such an environment code by default can do nothing malicious. The only thing making it insecure in any way are the syscalls offered by the operating system.
Please take my opinions as my own.
I don't mean to justify but rather to give context when I say that these discussion are not easy because there are lots of arguments and comments of varying degree of quality and emotional content, and contradicting voting. It's hard to represent an unpopular opinion. Still no justification whatsoever.