From JavaScript to Renderer Code Execution: Three V8 Vulnerabilities and Two v8CTF Flags
As part of the Open Defense Initiative, we used dfs-large1 to uncover three vulnerabilities in V8, Chrome’s JavaScript engine: two memory corruption and one sandbox escape. The two memory corruption vulnerabilities are CVE-2026-78938, a type confusion in Promise.prototype.finally, and CVE-2026-79236, a TurboFan load-elimination bug involving object migration. The sandbox escape, tracked as issue 546253900, affects shared WebAssembly memory. We developed two separate exploit chains by combining each memory corruption bug with the sandbox escape, achieving code execution in Chrome’s renderer process.
In August 2026, we used dfs-large1 to investigate V8. In our previous research on NGINX and FFmpeg, we explored how logic errors in widely deployed native code could lead to memory corruption. V8 presents a different challenge: an optimizing compiler can generate unsafe machine code even when the code implementing the optimization contains no obvious buffer overflow or dangling pointer.
We uncovered two memory corruption vulnerabilities and one V8 sandbox escape. The first memory corruption bug allowed an internal Promise helper to escape into JavaScript and behave as a constructor that returns a number. The second allowed optimized code to keep using an object’s old property storage after V8 had replaced it. Both broke assumptions the compiler relied on when removing checks, and thus both could be turned into controlled memory access.
However, memory access inside V8 is only part of a modern renderer exploit. The V8 heap sandbox is designed to contain exactly this kind of corruption. Our third finding, the sandbox escape, was a flaw in how shared WebAssembly memory tracks worker lifetimes. It left a dangling native pointer outside the sandbox. We combined each memory corruption bug with this escape to achieve native code execution.
Why a V8 Bug Is Only the Beginning
V8 executes the JavaScript and WebAssembly that web pages depend on. To make JavaScript fast, it uses optimizing compilers such as TurboFan to specialize code based on the types and object layouts it expects to encounter. If the compiler can establish that a value is an object, it can remove a redundant check (Redundant Type Check Elimination). If it knows that a field has not changed, it can reuse a previous load instead of reading memory again (Redundant Load Elimination).
These optimizations depend on the compiler’s understanding of program behavior matching what the runtime actually does. If an operation returns a value outside its expected type, or changes memory the optimizer believes is unchanged, the generated code can perform an unsafe access. A small semantic mismatch can become a memory corruption primitive.
The V8 sandbox adds another boundary inside the renderer process. It reserves a large memory region and constrains how V8 objects reference memory, aiming to keep a corrupted JavaScript heap from affecting the rest of the process. An attacker who gains read and write access inside that region still needs a way to reach native memory outside it.
CVE-2026-78938: When new Returns a Number
The first vulnerability, CVE-2026-78938, resides in how TurboFan creates the internal functions used by Promise.prototype.finally. JavaScript applications commonly use .finally() to perform cleanup after an asynchronous operation, regardless of whether it succeeds or fails:
fetch(url).finally(() => {
stopLoadingIndicator();
});
To implement this behavior, V8 creates two helper closures, PromiseThenFinally and PromiseCatchFinally. They invoke the supplied cleanup callback and arrange for the Promise chain to preserve the original fulfillment value or rejection reason. Each helper captures the cleanup callback and the Promise constructor it needs to continue the chain.
These helpers are intended to be internal, non-constructable functions. The generic builtin creates them through AllocateRootFunctionWithContext, which explicitly selects STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX. TurboFan’s ReducePromisePrototypeFinally, however, creates them through JSCreateClosure, whose lowering selects a function map from the helper’s SharedFunctionInfo. In src/heap/setup-heap-internal.cc, that metadata retained the default normal-function configuration. The optimized path therefore created helpers that were both non-strict and constructable, even though the generic path created strict functions that could not be called with new.
The non-strict configuration gives us a way to obtain the helper. Legacy JavaScript allows certain non-strict functions to inspect their caller through .caller. When PromiseThenFinally invokes a non-strict cleanup callback, that callback can save a reference to the internal function calling it:
let leakedFinally;
function onFinally() {
leakedFinally = onFinally.caller;
return 0;
}
function attachFinally(promise) {
return promise.finally(onFinally);
}
Once TurboFan optimizes attachFinally, calling it on a fulfilled Promise creates the incorrectly configured helper. The Promise reaction runs asynchronously, invokes onFinally, and assigns that helper to leakedFinally. After the reaction runs, JavaScript holds a reference to the internal PromiseThenFinally closure. Its constructable map also allows us to invoke it with new.
To understand what construction does here, we need to follow the helper’s return path. In src/builtins/promise-finally.tq, PromiseThenFinally calls the captured callback, resolves its result through the captured Promise constructor, and calls then on the resulting Promise. A small function named valueThunk returns the original fulfillment value when the cleanup completes. With the context lookups omitted, the relevant operations are:
const result = Call(context, onFinally, Undefined);
const promise = PromiseResolve(constructor, result);
const valueThunk = CreateValueThunkFunction(nativeContext, value);
return UnsafeCast<JSAny>(InvokeThen(nativeContext, promise, valueThunk));
The final line returns whatever the then method returns. Because JavaScript can replace Promise.prototype.then, we control that return value for a Promise inheriting the replacement. The internal helper simply propagates it back to its caller. Returning a primitive from this helper is allowed during an ordinary Promise reaction, but its incorrect function map also exposes this behavior through construction.
Normally, if a JavaScript constructor returns a primitive, new returns the newly created receiver object instead. This helper uses a different construction path: its builtin metadata selects JSBuiltinsConstructStub. On x64, the implementation in src/builtins/x64/builtins-x64.cc invokes the builtin and returns its result directly, without substituting the receiver when the result is a primitive. Consequently, replacing then with a function that returns an integer makes new leakedFinally() return that integer as well.
This breaks an assumption TurboFan relies on throughout optimization. TurboFan types every JSConstruct result as Receiver, meaning an object. A small integer, or Smi in V8 terminology, falls outside that type. If the compiler trusts the construction result, it can remove a CheckHeapObject that would otherwise reject a Smi before a memory access.
We can expose this mismatch by making the replacement then initially return an ordinary object, and using that object while optimizing a property access on the construction result:
const objectResult = {field: 0x41414141};
let returnPrimitive = false;
Promise.prototype.then = function() {
return returnPrimitive ? 1 : objectResult;
};
function readConstructedField() {
return (new leakedFinally()).field;
}
While returnPrimitive is false, calls to readConstructedField return the expected property value. After optimizing this function, we set returnPrimitive to true. The same helper now returns Smi 1 through the same replacement then, but the optimized property access still treats the construction result as an object. In our ASan build, the subsequent field access attempts a native read from address 0x1.
The useful primitive is the ability to introduce attacker-selected integer bits into optimized code that expects a heap-object pointer. To retain this confusion in a form we can control, we pass the construction result through a property whose representation holds only heap-object pointers. TurboFan’s object-result assumption lets it eliminate the check that should reject the Smi. A later load of that field as TaggedPointer decompresses the selected bits relative to the pointer-compression cage base, producing a cage-relative pointer from bits we control. By keeping this reference inside optimized code, we can use it to access forged object layouts and build the controlled memory reads and writes described below.
We bisected the vulnerable behavior to commit b158bfdc2f9b66de130b06e48f9e0cc25206c760, which relanded the removal of the construct_stub field from SharedFunctionInfo on April 5, 2018. The bug had been present for more than eight years when we found it.
CVE-2026-79236: A Map Check That Changes the Object
The second vulnerability, CVE-2026-79236, resides in TurboFan’s load-elimination pass. This optimization reuses previously loaded values when the compiler believes the underlying memory has not changed. Here, an operation that checks an object’s map can also migrate the object and replace its property storage. Load elimination preserves a pointer to the old storage across that migration, allowing a later property assignment to write through a value that is no longer a valid object pointer.
To understand how this happens, consider a JavaScript object with a property named y. V8 associates the object with a map, often called a hidden class, that describes where its properties live and how their values are represented. Some properties are stored inside the object itself. Others, including y in our trigger, live in an external PropertyArray reached through the object’s properties_or_hash field.
Initially, y holds a small integer, or Smi, directly in its property slot. If the property’s representation changes to Double, V8 needs a different layout: the out-of-object slot holds a pointer to a HeapNumber, which contains the floating-point value. The old map can become deprecated, and V8 migrates objects still using that map to the new layout when they are subsequently accessed. This migration allocates and installs a new PropertyArray. Updating the object’s map and replacing its property storage are therefore parts of the same operation.
Our trigger arranges for optimized code to load the external property array before an access that can migrate the same object. The first load comes from TurboFan’s homomorphic inline-cache path. Inline caches record information about previous property accesses so the compiler can generate specialized accesses. In this path, JSNativeContextSpecialization emits a load of properties_or_hash for an out-of-object property, and load elimination records the resulting pointer as a known field value.
The later access uses ordinary map-checking machinery. When PropertyAccessBuilder::BuildCheckMaps() sees that an accepted map is a migration target, it emits CheckMaps with the kTryMigrateInstance flag. At runtime, this check can migrate an object that still has a deprecated map. The operator definition accounts for that possibility by omitting Operator::kNoWrite on migration-capable checks: V8 already knows this operation may change memory.
The problem is in the special handling of CheckMaps in LoadElimination::ReduceCheckMaps(). The reducer reads the accepted map set and updates its abstract state, but does not distinguish a migration-capable check from a check that only inspects the map. After its existing map and state checks, the relevant code is:
state = state->SetMaps(object, maps, zone());
return UpdateState(node, state);
SetMaps updates what the compiler knows about the object’s map while preserving its previously tracked fields. That includes the old properties_or_hash value. Consequently, a later load of this field can be replaced with the pointer recorded before migration, even though migration has installed a different array. The generated code uses the new map’s property representation together with the old array’s contents.
For y, this leaves two different views of the same property:
| State | Property storage | Contents of the y slot |
|---|---|---|
| Actual object after migration | New PropertyArray | Pointer to a HeapNumber |
| Storage retained by optimized code | Old PropertyArray | Original Smi |
This becomes exploitable when the next operation assigns a floating-point value to y. Because the object has already migrated to the Double layout, the store is nontransitioning: it expects to find an existing HeapNumber in the property slot and update that object’s floating-point payload. The lowering loads the slot as MachineType::TaggedPointer, then writes through AccessBuilder::ForHeapNumberValue(). It performs no additional local check that the slot contains a HeapNumber; the map check and the property’s representation are supposed to guarantee that.
However, load elimination has substituted the old property array. The slot read by the store still contains the Smi we selected before migration. Loading that value as TaggedPointer interprets its tagged integer bits as a compressed pointer. The following payload store then writes the assigned floating-point value through that invalid pointer.
On our pointer-compressed x64 build, this gives us an eight-byte write at:
cage_base + raw_smi + 3
Here, raw_smi is the integer’s tagged encoding. Pointer decompression adds the cage base, and the payload access adds four bytes for the HeapNumber value offset while subtracting the one-byte heap-object tag. For example, choosing Smi 0x3fffffff gives tagged bits 0x7ffffffe, placing the write at cage_base + 0x80000001. We observed that write in our ASan build.
The primitive follows directly from the stale storage: we control the Smi in the old property slot, which determines the cage-relative write address, and the floating-point assignment, which determines the eight-byte payload. An ordinary property store therefore becomes a controlled memory write inside the pointer-compression cage. We use this initial corruption to build the more flexible memory-access primitives described below.
We reproduced the issue on the TurboFan path with homomorphic ICs enabled and bisected the trigger to the April 21, 2026 change that ported homomorphic ICs to TurboFan. The missing invalidation in load elimination allowed the property-array pointer exposed by that path to survive an operation that could replace it.
Different Bugs, the Same Memory Access
Both vulnerabilities give us a way to make generated code interpret attacker-controlled bits as a pointer. However, neither initial primitive is immediately convenient enough for the rest of the exploit. We need repeatable reads and writes, a way to locate useful objects, and a way to refer to them reliably.
For the Promise bug, we first move the impossible construction result through a property whose representation has been generalized to hold heap-object pointers. Because the compiler believes the result is an object, it removes the check that should reject the Smi. Reloading the field as a tagged pointer then combines the selected low bits with the pointer-compression cage base.
We keep this confused pointer inside optimized code and use it to construct a forged string layout. A sliced string represents part of another string, so accessing a character involves both the slice and its parent. In the forged layout, optimized charCodeAt checks the outer length without independently checking the forged parent’s length. This provides a forward byte-read window that can locate a live packed-double array and recover the appropriate map for that context.
With that map, forged packed-double arrays provide a more useful primitive. One array acts as a controller that changes the other’s elements pointer. Optimized element accesses on the second array then read or write the selected location.
For the migration bug, we reach similar primitives through the stale property accesses. One complication is that migration normally consumes the triggering state: after an object has migrated, the same setup cannot simply be repeated indefinitely. We therefore use multiple independent map families and bounded scans for markers in controlled array storage. Once we locate the relevant double-array and tagged-array backing stores, we can forge the array layouts we need.
Both paths eventually produce the familiar addrof and fakeobj primitives. addrof obtains an object’s compressed address, while fakeobj makes a selected address usable as an object reference. Combined with controlled array storage, these provide repeatable access within the 4 GiB pointer-compression cage.
The larger V8 sandbox in these builds spans 1 TiB. To access mapped memory elsewhere in that region, we locate genuine DataView objects and retarget a view’s encoded sandboxed data pointer. The view then provides exact reads and writes over selected mapped addresses within the sandbox.
At this point, the two very different entry bugs have converged. We can modify memory inside V8’s sandbox, including fields used by the next stage. We still need a native object outside that boundary that V8 can be induced to use unsafely.
One Sandbox Bypass for Both Exploits
Our third vulnerability, the V8 sandbox escape tracked as issue 546253900, resides in shared WebAssembly memory serialization and native isolate lifetime tracking. Both exploit chains use this finding after gaining memory access through one of the two memory corruption bugs.
WebAssembly memory can be shared between workers. The JavaScript objects describing that memory live inside V8, while a native backing store manages the actual memory and related bookkeeping. Each participating worker has a V8 isolate, the native structure representing an independent V8 execution environment.
When shared Wasm memory grows, V8 must notify the isolates using that memory. The backing store therefore retains a list of native Isolate* pointers. When an isolate is destroyed, those pointers must be removed. Otherwise, a later memory-growth notification can call into a freed isolate.
To perform that cleanup, V8 maintains a global registry of shared backing stores. The lifetime invariant is straightforward: a backing store that retains a participating isolate must be registered so teardown can find it.
The Worker Receives A, but V8 Registers B
The vulnerable serialization path establishes two related pieces of state through different mechanisms.
First, the serializer delegate tracks a SharedArrayBuffer by object identity and memoizes its backing store. Separately, ValueSerializer::WriteWasmMemory() registers a backing store obtained through the buffer object’s current extension handle. The relevant operations in that method are:
GlobalBackingStoreRegistry::Register(shared_ab->GetBackingStore());
// Other serialization steps omitted.
return WriteJSReceiver(shared_ab);
If the shared buffer has already been serialized, WriteJSReceiver emits an existing object reference. It does not ask the delegate to resolve the backing store again.
That extension handle is stored in the sandbox. With the memory access obtained from either entry bug, we can replace it with another genuine handle of the correct type. The handle remains valid, but now refers to a different backing store.
Call the original backing store A and the replacement B. The sequence is:
- Serialize the shared buffer so the delegate memoizes A.
- During serialization of the surrounding object graph, use a getter to substitute B’s extension handle into the buffer object.
- Serialize the Wasm memory. Registration follows the substituted handle and registers B.
- The reference to the already serialized buffer resolves through the earlier identity bookkeeping, so the worker receives A.
The worker attaches its native isolate pointer to A. However, only B was registered by the vulnerable path. Registration and delivery have silently diverged.
When the worker terminates, teardown visits registered backing stores and removes references to the dying isolate. It misses A. The worker’s native isolate is freed, while A retains a pointer to the old allocation.
After restoring the buffer’s original extension handle, a later memory.grow(0) walks A’s isolate list and reaches the freed isolate through StackGuard::RequestInterrupt(). This is a native use-after-free outside the V8 sandbox. The standalone sandbox reproducer produced a symbolized ASan report and a detected sandbox violation.
The external pointer handle did not need to reference an invented address. Both handles were genuine. The failure was that two legitimate mechanisms disagreed about which backing store was being shared, allowing the lifetime bookkeeping to fall apart.
From a Dangling Isolate to Renderer Code Execution
A native use-after-free gives us an opportunity to corrupt execution, but there is still substantial work between the crash and reading the flag. We need the right addresses, control over the freed allocation, and a path through the target binary’s control-flow constraints.
Finding the Native Addresses
Our browser chain used an Intl-based sequential native read and a CompressionStream zlib object to recover a BufferPartition address and the Chrome executable’s base address. BufferPartition is part of Chrome’s native allocation machinery; the executable base lets us resolve the build-specific code locations required later in the chain.
We also needed the exact address of the worker isolate that would become dangling. By locating a worker-registry allocation through adjacent native string allocations, the exploit recovered the isolate address before teardown. After worker destruction, it confirmed the registry entry’s removal.
These disclosures gave us a concrete allocation to target and the native addresses needed to prepare its replacement. They were essential parts of the browser exploit beyond the initial sandbox violation.
Reclaiming the Freed Isolate
The freed isolate occupied a 0x20000 single-slot allocation in the target’s allocator layout. To replace its contents, the exploit queued a WebSocket binary message with a 0x1fffc-byte payload. Its native MessageData allocation used the matching allocation size and could occupy the freed isolate’s slot, copying attacker-controlled bytes into it.
Simply requesting an allocation of the right size is not enough. Another allocation could take the slot first, or the message could land somewhere else. Triggering the stale pointer under those conditions would produce a crash instead of the intended control flow.
We therefore checked the reclaim explicitly. The exploit disclosed the queued message’s native payload address and continued only when that address exactly matched the dangling isolate address.
This was a useful property of the final chain: the critical allocation placement was observable before the stale access was triggered.
Following the Callback Path
Once the message occupies the old isolate allocation, memory.grow(0) causes V8 to interpret our payload as the freed native isolate. The payload supplies the relevant StackGuard and mutex layout, steering execution into the selected callback path.
Chrome’s control-flow integrity, or CFI, constrains indirect calls to compatible targets. The chain follows build-specific callbacks that satisfy the checks on the path until it reaches an unchecked indirect dispatch. From there, it pivots the stack into the reclaimed allocation and executes an aligned ROP chain which gives us full control of chrome’s render process.
Fixing the Broken Assumptions
The fixes address different points where one component trusted an assumption another component could invalidate.
For CVE-2026-78938, V8 landed the change “Native builtins are strict”, recorded as fixed on August 21. Making the internal builtin functions strict closes the caller-exposure path used to obtain the Promise helper. The exploit depended on reaching that internal function before invoking its unusual construction behavior.
For CVE-2026-79236, the fix invalidates tracked fields across migration-capable CheckMaps operations, recorded as fixed on August 20. Once migration can replace object storage, the optimizer must discard the old field information and reload what it needs. Updating the map information alone does not describe all the operation’s effects.
For the shared-Wasm sandbox bypass, V8 moved backing-store registration to attachment, recorded as fixed on August 20, with a related follow-up change recorded on August 25. The maintainer’s analysis explains the invariant directly: registering the isolate in a backing store and registering that backing store globally must happen together, on the same backing store. This ensures teardown can find and remove the native isolate pointer.
Timeline
Dates below follow the issue tracker’s displayed comment dates.
- August 12, 2026: We reported the
Promise.prototype.finallyvulnerability, later assigned CVE-2026-78938. The first v8CTF submission issue was created. - August 13, 2026: We reported the shared-Wasm sandbox bypass, tracked as issue 546253900, and added a proof of instruction-pointer control.
- August 14, 2026: We reported the migration/load-elimination vulnerability, later assigned CVE-2026-79236. The second v8CTF submission issue was created, and we attached the exploit archives and writeups to both submissions.
- August 17, 2026: Google reproduced and accepted both v8CTF exploits.
- August 20, 2026: The load-elimination bug and shared-Wasm sandbox bypass were marked fixed upstream.
- August 21, 2026: The Promise vulnerability was marked fixed upstream.
- August 24, 2026: Both v8CTF submission entry vulnerabilities were assigned CVE-2026-78938 and CVE-2026-79236.
- August 25, 2026: A related backing-store registration follow-up was recorded in the sandbox issue.