Inappropriate implementation in V8 (CVE-2026-7999)
A stale cached string preparation in V8's Wasm load elimination allows a JS import to internalize a string and change its representation, so a subsequent charCodeAt reads from the wrong layout and returns non-character data. This leads to a stable non-crashing memory disclosure that can leak pointer-derived values.
Originally disclosed on Chrome VRP
- Fix shipped in 51 days
VULNERABILITY DETAILS
wasm:js-string.charCodeAt lowers through StringAsWtf16 to GetCodeUnitImpl, which calls StringPrepareForGetCodeUnit and then performs a raw immutable load using the prepared (base, base_offset, charwidth_shift) tuple.
Turboshaft Wasm load elimination caches StringPrepareForGetCodeUnit as a load-like entry keyed by the string input. If a JS import executes code that uses the string as a property key, that JS can internalize the string and rewrite it from a sequential string to a thin string. However, the cached preparation survives the call because InvalidateMaybeAliasing() skips load-like entries whose mutability == false:
template <EntriesWithOffsets offsets = EntriesWithOffsets::kInvalidate>
void InvalidateMaybeAliasing() {
for (auto& base_keys : base_keys_) {
OpIndex base = base_keys.first;
if (non_aliasing_objects_.Get(base)) continue;
if constexpr (offsets == EntriesWithOffsets::kInvalidate) {
for (auto it = base_keys.second.with_offsets.begin();
it != base_keys.second.with_offsets.end();) {
Key key = *it;
if (key.data().mem.mutability == false) {
++it;
continue;
}
it = base_keys.second.with_offsets.RemoveAt(it);
Set(key, OpIndex::Invalid());
}
}
}
}
The next charCodeAt therefore reuses a stale sequential-string layout after a call whose JS body can change string representation, and on the tested build it returns non-character data instead of the original string bytes.
On a current V8 development build, this is a stable non-crashing V8-side memory disclosure reachable from Wasm. The attached addrof PoC uses the same stale StringPrepareForGetCodeUnit reuse bug to leak a pointer-derived low32 value from the internalized key string path. The PoC then places nearby heap objects in an attacker-controlled allocation schedule (key, sym, then tmp, with warm-up and GC to stabilize placement), so the leaked key address can be combined with a stable relative delta in this exact schedule to derive the low 32 bits of the tmp object's address inside the V8 cage. In the reproduced output below, addrof_tmp_tagged=0x10bc2c9 matches the low32 reported by %DebugPrint(tmp).
VERSION
Version tested: current V8 development d8 build from revision 8274e932001c26f5282ec0e26e4dfe1717d32e08 (V8 version 14.8.0 (candidate)).
REPRODUCTION CASE
Attached files:
poc.js
Run d8 poc.js --allow-natives-syntax --expose-gc.
Result:
leaked_key_tagged=0x1093755
leaked_key=0x1093754
tmp_key_delta=0x28b74
addrof_tmp=0x10bc2c8
addrof_tmp_tagged=0x10bc2c9
tmp_debugprint:
DebugPrint: 0x...010bc2c9: [JS_OBJECT_TYPE] in OldSpace
addrof_tmp_tagged matches the low 32 bits of the tagged address printed by %DebugPrint(tmp).
The key side effect that makes the stale preparation invalid is the property-key operation inside this JS import:
ext(s) {
const o = {};
o[s];
}
The import call itself is not the important part; the important part is that the JS body uses s as a property key. In this setup, that property-key processing internalizes the string and rewrites the original sequential string as a thin string. After tier-up, the Wasm code reuses the stale StringPrepareForGetCodeUnit result created for the pre-internalization sequential string, so the later charCodeAt reads from the wrong layout.
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash: N/A (non-crashing memory disclosure) Crash State: N/A Client ID (if relevant): N/A
CREDIT INFORMATION
Reporter credit: Taisic Yun (@taisic) of Theori
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Wasm load elimination's invalidation logic skips load-like entries marked as immutable, so a cached string preparation survives a call that can change the string's representation.
Impact
This is a stable non-crashing memory disclosure that could leak pointer-derived values, potentially aiding further exploitation.
What the attacker needed
Ability to run Wasm code with a JS import; specific heap layout for pointer leak
How it was found
- Run the provided PoC with d8 using the flags --allow-natives-syntax and --expose-gc.
- The PoC uses a JS import that internalizes a string by using it as a property key.
- After tier-up, the Wasm code reuses the stale string preparation and charCodeAt returns non-character data.
- The PoC leaks a pointer-derived low32 value and uses heap placement to derive the low 32 bits of another object's address.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
V8 is the JavaScript engine used by Chrome and Node.js. It sometimes caches information about a string to speed up repeated operations, but here the cache was not cleared when a JavaScript function changed the string's internal representation. As a result, a later operation read the wrong memory and leaked data.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.