News for hackers. Stuff that matters.
Re:Making WebAssembly a first-class language on the Web by lich_king on Wednesday March 11, 2026 @02:09PM (#47339076)
The web is fascinating: we started with a seemingly insane proposition that we could let anyone run complex programs on your machine without causing profound security issues. And it turned out that this was insane: we endured 20 years of serious browser security bugs caused chiefly by JavaScript. I'm not saying it wasn't worth it, but it was also crazy.

And now that we're getting close to have the right design principles and mitigations in place and 0-days in JS engines are getting expensive and rare... we're set on ripping it all out and replacing it with a new and even riskier execution paradigm.

I'm not mad, it's kind of beautiful.

Re:Making WebAssembly a first-class language on the Web by traderj0e on Wednesday March 11, 2026 @02:29PM (#47339327)
I only got mad when people wanted to add browser features that clearly break sandboxing like WebUSB. How does wasm break this?
Re:Making WebAssembly a first-class language on the Web by Retr0id on Wednesday March 11, 2026 @02:27PM (#47339304)
What makes WASM execution riskier than JS?
Re:Making WebAssembly a first-class language on the Web by observationist on Wednesday March 11, 2026 @02:33PM (#47339380)
Novelty - JS has had more time and effort spent in hardening it, across the browsers, WASM isn't as thoroughly battle-tested, so there will be novel attacks and exploits.
Re:Making WebAssembly a first-class language on the Web by JoshTriplett on Wednesday March 11, 2026 @02:38PM (#47339445)
That would be more true if WebAssembly didn't share so much sandboxing infrastructure with JS. If anything, I'd argue that WebAssembly is a much smaller surface area than JavaScript, and I think that will still be true even when DOM is directly exposed to WebAssemly.
Re:Making WebAssembly a first-class language on the Web by lich_king on Wednesday March 11, 2026 @02:55PM (#47339664)
I don't think it's "much smaller" once you aim for feature parity (DOM). It might be more regular than an implementation of a higher-level language, but we're not getting rid of JS.

By the same token, was Java or Flash more dangerous than JS? On paper, no - all the same, just three virtual machines. But having all three in a browser made things fun back in the early 2000s.

Re:Making WebAssembly a first-class language on the Web by cogman10 on Wednesday March 11, 2026 @03:32PM (#47340126)
It is much smaller.

WASM today has no access to anything that isn't given to it from JS. That means that the only possible places to exploit are bugs in the JIT, something that exists as well for JavaScript.

Even WASM gets bindings to the DOM, it's surface area is still smaller as Javascript has access to a bunch more APIs that aren't the DOM. For example, WebUSB.

And even if WASM gets feature parity with Javascript, it will only be as dangerous as Javascript itself. The main actual risk for WASM would be the host language having memory safety bugs (such as C++).

So why was Java and Flash dangerous in the browser (and activex, NaCL).

The answer is quite simple. Those VMs had dangerous components in them. Both Java and Flash had the ability to reach out and scribble on a random dll in the operating system or to upload a random file from the user folder. Java relied HEAVILY on the security manager stopping you from doing that, IDK what flash used. Javascript has no such capability (well, at least it didn't when flash and Java were in the browser, IDK about now). For Java, you were running in a full JVM which means a single exploit gave you the power to do whatever the JVM was capable of doing. For Javascript, an exploit on Javascript still bound you to the javascript sandbox. That mostly meant that you might expose information for the current webpage.

Re:Making WebAssembly a first-class language on the Web by JoshTriplett on Wednesday March 11, 2026 @05:43PM (#47342446)
I think even when WebAssembly has access to every API that JavaScript does, it's still architected in a way that I think is less likely to lead to sandbox escapes. The thing doing the sandboxing doesn't have the full complexity of a programming language; some of that complexity lives either in the compiler or inside the sandbox. Some things that would be vulnerabilities in JavaScript become "it rather involved being on the other side of this airtight hatchway" problems in WebAssembly.
Re:Making WebAssembly a first-class language on the Web by embedding-shape on Wednesday March 11, 2026 @02:39PM (#47339471)
> Novelty - JS has had more time and effort spent in hardening it

Taking this argument to its extreme, does this mean that introducing new technology always decreases technology? Because even if the technology would be more secure, just the fact that it's new makes it less secure in your mind, so then the only favorable move is to never adopt anything new?

Supposedly you have to be aware of some inherent weakness in WASM to feel like it isn't worth introducing, otherwise shouldn't we try to adopt more safe and secure technologies?

Re:Making WebAssembly a first-class language on the Web by seangrogg on Wednesday March 11, 2026 @04:14PM (#47340808)
> Taking this argument to its extreme, does this mean that introducing new technology always decreases technology?

I assume you mean "decreases security" by context. And in that case - purely from a security standpoint - generally speaking the answer is yes. This is why security can often be a PITA when you're trying to adopt new things and innovate, meanwhile by default security wants things that have been demonstrated to work well. It's a known catch-22.

Re:Making WebAssembly a first-class language on the Web by fenykep on Wednesday March 11, 2026 @02:53PM (#47339634)
To be fair I think this could be true for certain industries/applications. And while I obviously don't agree with the extreme example, any new technology, especially if it brings a new paradigm has more unknown unknowns which carries potential voulnerabilities.
Re:Making WebAssembly a first-class language on the Web by kccqzy on Wednesday March 11, 2026 @02:44PM (#47339521)
There is very significant overlap between browsers’ implementation of JS and WASM. For example in V8, the TurboFan compiler works for both JS and WASM. Compilation aside, all the sandboxing work done on JS apply to WASM too. This isn’t NaCl.
Re:Making WebAssembly a first-class language on the Web by Retr0id on Wednesday March 11, 2026 @02:37PM (#47339428)
On one hand, yes, new attack surface is new attack surface. But WASM has been in browsers for almost a decade now.
Re:Making WebAssembly a first-class language on the Web by lich_king on Wednesday March 11, 2026 @02:56PM (#47339681)
Without the bindings this talks about, so it really couldn't do nearly as much.
Re:Making WebAssembly a first-class language on the Web by 0x457 on Wednesday March 11, 2026 @08:13PM (#47344457)
WASM has access to everything JS has via JS in the same sandbox that JS runs in.

JS didn't magically become more "secure". Multiple things happened:

- ActiveX and Flash got booted from browsers

- Browsers got much better sandboxes

Essentially limited what untrusted code can run and sandboxed that untrusted code. Before NaCl and PNaCl it was wild west in browsers.

The same sandbox runs WASM. It even goes through the same runtime in every browser. It's no different from compiling language of your choice to subset of JavaScript (see asm.js).

Re:Making WebAssembly a first-class language on the Web by skrtskrt on Wednesday March 11, 2026 @05:36PM (#47342333)
> JS has had more time and effort spent in hardening it

JS required the time and effort because it's a clown-car nightmare of a design from top to bottom. How many person-hours and CPU cycles were spent on papering over and fixing things that never should have existed in the first place?

This doesn't even count as a sunk cost fallacy, because the cost is still being paid by everyone who can't even get upgraded to the current "better" version of everything.

The sooner JavaScript falls out of favor the better.

Re:Making WebAssembly a first-class language on the Web by leptons on Wednesday March 11, 2026 @03:11PM (#47339860)
>20 years of serious browser security bugs caused chiefly by JavaScript

I think you may be confusing Javascript the language, with browser APIs. Javascript itself is not insecure and hasn't been for a very long time, it's typically the things it interfaces with that cause the security holes. Quite a lot of people still seem to confuse Javascript with the rest of the stuff around it, like DOM, browser APIs, etc.

Re:Making WebAssembly a first-class language on the Web by strongpigeon on Wednesday March 11, 2026 @03:18PM (#47339944)
That’s not entirely true. Security issues in the JIT of V8 are found every now and then. See https://v8.dev/blog/sandbox
Re:Making WebAssembly a first-class language on the Web by leptons on Wednesday March 11, 2026 @07:11PM (#47343731)
Javascript isn't more insecure than any other language. Any language can have the same or other security issues.
Re:Making WebAssembly a first-class language on the Web by echoangle on Wednesday March 11, 2026 @07:58PM (#47344304)
Yeah, but you're not normally going to random websites, downloading an exe and running it. But every website you visit can run JS on your computer (as long as you don't disable JS). So maybe JS should be more secure than any other language.
Re:Making WebAssembly a first-class language on the Web by leptons on Wednesday March 11, 2026 @11:40PM (#47346167)
>So maybe JS should be more secure than any other language.

And it probably is. The sandboxing and security have been around a very long time.

If Python were the de-facto browser language, people would also blame it for "security problems", and would be just as paranoid about python running when they visit a website. I know whatever language it would be, people would still be paranoid.

I personally don't see any problem with Javascript. If someone knows how to use it, it can be very simple and powerful.

Before Javascript ever existed, I was wishing that websites had a scripting language. I didn't really care what it was, but Javascript answered my prayers rather nicely. But it wouldn't really matter what the language is, I'd still be coding for the web browser, and other people would be hating it for whatever reasons.

Re:Making WebAssembly a first-class language on the Web by teruakohatu on Thursday March 12, 2026 @02:55AM (#47347359)
> Yeah, but you're not normally going to random websites, downloading an exe and running it.

Most or many of secure mobile operating system zero days are caused by image parsing. There is a threat at least as big, if not bigger, in parsing complex file formats.

Sure gopher or gemini would be more secure, but even without JS the web ecosystem would be venerable.

Re:Making WebAssembly a first-class language on the Web by strongpigeon on Thursday March 12, 2026 @11:25AM (#47352111)
Reality is a bit more nuanced that that. Some languages are easier to interpret and optimize than others, leading to less error-prone interpreter/compiler code. JS is definitely on the “harder to optimize” side of the spectrum, leading to very complex code with a higher chance of subtle errors.

V8 does some crazy stuff that makes JS one of the fastest interpreted language there is. But had JS been designed differently (Dart was an attempt at fixing some of those mistakes), it’s likely there would be less security vulnerabilities in its interpreter.

Re:Making WebAssembly a first-class language on the Web by spankalee on Wednesday March 11, 2026 @07:33PM (#47344024)
Nothing is being ripped out or replaced.
Re:Making WebAssembly a first-class language on the Web by rishflab on Wednesday March 11, 2026 @07:33PM (#47344028)
> The web is fascinating: we started with a seemingly insane proposition that we could let anyone run complex programs on your machine without causing profound security issues.

Isnt this what an OS is supposed to do? Mobile operating systems have done a pretty good job of this compared to the desktop OS.

Re:Making WebAssembly a first-class language on the Web by jitl on Wednesday March 11, 2026 @08:16PM (#47344488)
mobile operating systems review all the code that gets installed on every device
Re:Making WebAssembly a first-class language on the Web by rishflab on Wednesday March 11, 2026 @09:18PM (#47345020)
Security does not depend on code review. They have stronger sandboxing and have granular permissions that the user must allow. My point is running untrusted code securely should be the operating systems job. It is possible to do this at the operating system level, a browser is not required. The problem is the security model for desktop operating systems is ancient and has not kept up with today's requirements.
Re:Making WebAssembly a first-class language on the Web by lich_king on Wednesday March 11, 2026 @10:38PM (#47345690)
Mobile OSes don't allow random people to run code on your device. They allow you to install software you want and sort-of trust, which is conceptually close to the desktop model. There are some safeguards on top of that, but the primary line of defense is that cheap-pillz.virus-basket.ru can't actually execute anything on your device.
Re:Making WebAssembly a first-class language on the Web by pjmlp on Thursday March 12, 2026 @04:23AM (#47347928)
Desktop model at least on Apple, Google and Microsoft platforms is slowly adopting similar security models, boiling water and frogs kind of approach.
Re:Making WebAssembly a first-class language on the Web by scuff3d on Wednesday March 11, 2026 @11:24PM (#47346058)
It's worth it if it gets rid of JavaScript
Re:Making WebAssembly a first-class language on the Web by silon42 on Thursday March 12, 2026 @02:22AM (#47347149)
"out of the frying pan into the fire"...

I'd like to avoid wasm too...

Re:Making WebAssembly a first-class language on the Web by scuff3d on Thursday March 12, 2026 @05:03PM (#47357067)
To each their own. Anything that frees people from the misery of JavaScript and front end frameworks is a good thing in my book.
Re:Making WebAssembly a first-class language on the Web by mendyberger on Thursday March 12, 2026 @09:17AM (#47350148)
Wasm is safer since it has a much smaller attack surface.
Re:Making WebAssembly a first-class language on the Web by easterncalculus on Thursday March 12, 2026 @03:00PM (#47355533)
0-days mostly got expensive from compiler optimizations and other security guarantees that carry over to webassembly, like ASLR and pointer authentication, as well as sandboxes and multi-process architectures. It's not all thrown away here.

Browsers are millions of lines of code, the amount of UAFs, overflows, etc so far is not the bottleneck.