Live data from Hacker News

Actively exploited sandbox RCE in all Chromium versions

nvd.nist.gov

531–540 of 548 posts

Re: Actively exploited sandbox RCE in all Chromium versions

#531

Earlier quoted context omitted.

The Chromium issue is not public yet, so let's go with a very simple example. Let's say that you have a type confusion bug that (in terms of the interpreted language) allows you to use an Integer variable as an Array. That sounds nonsensical when just considering the high-level language, but your computer is going to need something to work with when running a script. For an Integer variable it will for example store…

I appreciate the thorough explanation... you seem to understand the domain... but I still don't get how this would work in practice. My experience with C/C++ is somewhat limited but I imagine V8 does something like reserve a whole bunch of addresses and then manage them itself, with some internal list where script arrays/objects correspond to blocks. Or maybe it delegates some of that to C++ vectors that can scale up…

> you seem to understand the domain

I'll have to note that I'm probably way worse than anyone doing this professionally or semi-professionally. This is the extent of what I learned as part of university, which was exclusively using planted vulnerabilities. The knowledge required to find and exploit such issues in a real-world scenario goes much deeper. My dayjob in security is on the entirely opposite side, since I'm doing defensive security on the system-level.

In short, it is quite likely that someone may join in and point out where my information is outdated or plain wrong. (Please do so!)

> My experience with C/C++ is somewhat limited but I imagine V8 does something like reserve a whole bunch of addresses and then manage them itself [...]

That is essentially correct, that's what the 4 Gigabyte allocation I mentioned before is. Let's call it the "v8 heap", because it is distinct from the heap that your system manages (which is the one used for `malloc` and `new`), but it will largely work in the same way.

> [...] with some internal list where script arrays/objects correspond to blocks.

v8 does have a lot of internal checks to make sure that what it is touching looks sane (at least on debug builds), but it will not have a lot of duplicated information. Having to check or update information in multiple places is both an artificial limit on performance as well as its own source of bugs (if not kept in sync correctly).

If v8 needs a JavaScript Object then it will simply ask the v8 heap for an appropriately sized memory allocation and fill in its data there, not unlike normal C or C++ objects (except that v8 usually refcounts, I believe). After this it will simply continue to work with the pointer that it already has.

> But what scripted integer or array could you pass it that would access anything already freed or outside the bounds of the addresses that array was mapped to?

You need to keep in mind that in this scenario, reading/writing outside the intended memory area is already the effect that we want to achieve, it is not the vulnerability.

We are not abusing some insufficient bounds check on an existing Array, _we make v8 believe that there is an Array_ (or at the very least something that it can use like one; in either case it's completely made up), and it happens to have its data stored at the location and length that we want.

> Wouldn't that have been accounted for in the most basic design?

Yes, and for that reason the interpreter itself is considered pretty much battle-tested. However, in search for more performance, multiple JavaScript engines have turned towards engineering Just-In-Time compilers to accelerate running code that runs so often that the compile overhead is worth it. v8 / Chromium / Google alone have a set of three JIT compilers (Sparkplug, Maglev, TurboFan) that compile interpreter bytecode to actual machine instructions depending on what is currently required and how fast the resulting code should be.

> What's an actual snippet of pseudo-JS that could make the engine overrun its memory and start reading out of arbitrary addresses, even within the sandbox?

Those are a bit hard to come by, even more so since the focus for v8 exploitation has changed to targeting the JIT compilers. This usually means that a lot of the exploit would be concerned with wrangling the compiler into place.

I'll try to give an example of what a type confusion involving the JIT compiler looks like, but this is based on work by my classmates, since I never finished that particular part of the exercise. It is also recited purely from recollection, since I'm not near my university notes.

To get the best possible code optimization the compiler wants to work with some assumptions. If any of those don't hold anymore, the compiler should either never have optimized or at the very least it should deoptimize before anything happens and fall back to a more flexible way of running that code.

One such nugget of information is whether certain well-known properties (let's say .name) can have side effects, those are kept as lists in the source code of the compiler [1]. If the compiler is told that .name can not mutate its object (contrary to the specification and the remainder of the v8 implementation), then it may choose to elide type change checks within the optimized function (that has already been optimized for a specific type) and miss a deoptimization.

If v8 then uses the optimized function after it should have been deoptimized, we essentially get a function that uses an area of memory as if it were a different type of object.

PS: I should get back into this, even just explaining already-done things sounds fun.

[1] https://chromium.googlesource.com/v8/v8/+/9f30cc5fc4ad6c3236...

Re: Actively exploited sandbox RCE in all Chromium versions

#532

Earlier quoted context omitted.

Especially today, single-user stuff, especially in categories of things like health, especially when you’re writing your own stuff, that’s when you know from the start that scaling doesn’t matter! =] Related, and more powerful than my comments in this thread are going to be: https://www.robinsloan.com/notes/home-cooked-app/

I don't only mean "scale" in terms of users but also scale in terms of features. So you have to guarantee that your product will stay low users and low features forever or spend a very high effort to try to partially overcome that block when you change your mind. And guaranteeing that it will stay low features is much harder than low users I think. In exchange for that you get a better talent pool for recruiting but…

Or you have to distribute your code in such a fashion, and structure your business model in such a way, that “scale” doesn’t require you doing things that have nothing to do with providing the feature set (most SaaS).

Re: Actively exploited sandbox RCE in all Chromium versions

#533

Earlier quoted context omitted.

Single HTML files / pages can be fully-featured, full-purpose-fulfilling applications. > Most websites or applications are hybrids. and some are emphatically not . But…where were you going with that?

The features of HTML are still greatly limited. You can’t really create applications with just one HTML page and no client-side rendering. You can play a video, sure, but that’s not an application. You can also do magic with CSS but that’s an experimental fun thing, not a thing people actually do. As soon as you, say, use JS to update the DOM or a canvas, I consider that client-side rendering. That you can do, and th…

You can inline the following in one HTML page:

CSS (.css) JavaScript (.js) Plain Text (.txt) HTML (.html) SVG (.svg) Raster Images (.png, .jpg, .jpeg, .gif, .webp, .bmp) Audio (.mp3, .wav, .ogg) Video (.mp4, .webm) JSON (.json) PDF (.pdf)

plus bring in other source resources as needed.

To answer your question:

The installer for GrapheneOS / Google Pixel phones is an “SPA” (or “webapp”).

I’ve seen bespoke fitness trackers of all kinds,

appliance control apps,

budget and pace-tracking stuff,

basically all of what computer programs used to do - before we started dynamically loading a ton of extra stuff onto the screen that nobody needed to do the task they came to do.

Re: Actively exploited sandbox RCE in all Chromium versions

#534
post #295

Earlier quoted context omitted.

There's a risk that someone had been sitting on a sandbox escape that assumed having RCE inside the sandbox first, and so they'd been waiting for an RCE exactly like this one. Those folks would not be disclosing their sandbox escape unless they were good guys. (Posted with a memory safe WebKit, Fil-C FTW)

You should add a disclaimer that you are the CEO of Fil-C. /s In the context of this vulnerability, I doubt memory safety would have made much of a difference. This is a great reminder though, currently doing a full userspace replacement on my 3D printer and Fil-C might be just what I need for the irreplaceable C parts.

Type confusion, leads to using an object in memory with the wrong type, that means accessing memory with a different layout, like an out of bounds buffer.

So I think memory safety does matter in that case.

Re: Actively exploited sandbox RCE in all Chromium versions

#535

Earlier quoted context omitted.

I don't only mean "scale" in terms of users but also scale in terms of features. So you have to guarantee that your product will stay low users and low features forever or spend a very high effort to try to partially overcome that block when you change your mind. And guaranteeing that it will stay low features is much harder than low users I think. In exchange for that you get a better talent pool for recruiting but…

Or you have to distribute your code in such a fashion, and structure your business model in such a way, that “scale” doesn’t require you doing things that have nothing to do with providing the feature set (most SaaS).

I'm currently working on a SaaS at my company and we have a lot of issues because of the SPA, I estimate we spend around 5% at least, maybe 10% of the workforce just on SPA complexity.

It can work for some SaaS but if you stay low employee count, low users and you have a core feature used everywhere in the whole product and nothing else

Re: Actively exploited sandbox RCE in all Chromium versions

#536

Earlier quoted context omitted.

I appreciate the thorough explanation... you seem to understand the domain... but I still don't get how this would work in practice. My experience with C/C++ is somewhat limited but I imagine V8 does something like reserve a whole bunch of addresses and then manage them itself, with some internal list where script arrays/objects correspond to blocks. Or maybe it delegates some of that to C++ vectors that can scale up…

> you seem to understand the domain I'll have to note that I'm probably way worse than anyone doing this professionally or semi-professionally. This is the extent of what I learned as part of university, which was exclusively using planted vulnerabilities. The knowledge required to find and exploit such issues in a real-world scenario goes much deeper. My dayjob in security is on the entirely opposite side, since I'm…

Wow. If I understand, your .name example kinda blows my mind. So that would be where the JIT compiler might be pre-optimized to expect a certain length for a supposedly immutable parameter... right? Even if the spec makes everthing mutable. I didn't know that was part of the optimization, but it makes some sense.

That makes it possible for me to visualize how a use-after-free might work inside a JIT engine's sandbox. If I'm not misunderstanding, you're saying that the type confusion attack could be accessed by changing something as simple as the prototype for Object, in a way that the JIT compiler was hardcoded to ignore? Essentially that the compiler is not built to spec, and then getting the garbage collector to somehow free the extra memory, it's still possible to open a hole to read sequential blocks. But the main flaw would be that the compiler reserves X memory for quickly writing an object and then in some unoptimized phase sees that the object only took up X-y and reuses a portion of it...?

I'm a high school dropout..Am I seeing this right?

Re: Actively exploited sandbox RCE in all Chromium versions

#537

Earlier quoted context omitted.

Or you have to distribute your code in such a fashion, and structure your business model in such a way, that “scale” doesn’t require you doing things that have nothing to do with providing the feature set (most SaaS).

I'm currently working on a SaaS at my company and we have a lot of issues because of the SPA, I estimate we spend around 5% at least, maybe 10% of the workforce just on SPA complexity. It can work for some SaaS but if you stay low employee count, low users and you have a core feature used everywhere in the whole product and nothing else

What’s the stack? Is it being used even sort-of in the right place / way?

Feels like a glaring omission =]

Re: Actively exploited sandbox RCE in all Chromium versions

#538

Normalising running arbitrary code delivered over the internet (in the form of JavaScript and WASM), as a necessary condition for accessing most web pages may not have been one of the best decisions we have made.

Yes it's been a disaster for accessibility, compatibility, interoperability, energy efficiency and computing freedom (good luck using a Browser not approved by Buttflare).

The security implications are just the cherry on top.

Re: Actively exploited sandbox RCE in all Chromium versions

#539

Earlier quoted context omitted.

I think the problem is that we've let JS engines become absurdly complex so there's no way to avoid them having really gross bugs. That said, I think that the V8 team has done a fantastic job of securing their engine. Their heap sandbox feature is really inspiring! It's really wild that (as far as I can understand this issue) someone is able to bypass it. (Posted from a memory safe browser - WebKit MiniBrowser compil…

When Chromium and V8 are written in a memory-safe language then I might believe this. Yes, if your JavaScript engine is written in C++, it’s going to be very hard to avoid very gross bugs. We have better options now. The ability of adversaries to find and exploit very gross bugs in C++ codebases should have already compelled the industry to move to memory safety. Now that AI has democratized the ability to scour C++…

A JIT by definition bypasses the safety mechanisms of whatever language you write it in. Think before you post.

Re: Actively exploited sandbox RCE in all Chromium versions

#540

Earlier quoted context omitted.

I'm currently working on a SaaS at my company and we have a lot of issues because of the SPA, I estimate we spend around 5% at least, maybe 10% of the workforce just on SPA complexity. It can work for some SaaS but if you stay low employee count, low users and you have a core feature used everywhere in the whole product and nothing else

What’s the stack? Is it being used even sort-of in the right place / way? Feels like a glaring omission =]

The stack is Rails / React SPA for the frontend.

> Is it being used even sort-of in the right place / way?

It's a SaaS where users are mostly always logged-in, kind of an app so you would think it should work from the outside.

I think these are the full requirements I would put for a good SPA experience:

- low users

- low number of features / or a single main feature reused in different ways

- low number of employees

- it's an app and not a website

- you don't have any users living in remote places / poor internet connection

- users are all using modern browsers and can be asked to switch to another one if needed

And I think in my company we only have one of this list, making it painful.

Post reply on HN