Use after free in V8 (CVE-2026-14432)
A data race between the garbage collector's Mark() and the mutator's Publish()/Unpublish() on a TrustedPointerTableEntry can cause a live entry's mark bit to be lost, leading to premature freeing. An attacker could exploit this to cause a use-after-free and object confusion within V8's Trusted Space.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 16 days
Flapjack has identified a security issue and generated a PoC.
Build variant: Default
Build arguments: v8_enable_sandbox=true v8_enable_memory_corruption_api=true
Shell command: d8 --stress-incremental-marking --concurrent-marking-high-priority-threads --omit-quit --fuzzing --disallow-unsafe-flags --disable-in-process-stack-traces
Return code: 134
<details> <summary>stdout</summary>iter 10
iter 20
iter 30
iter 40
iter 50
#
# Fatal error in ../../v8/src/sandbox/trusted-pointer-table-inl.h, line 113
# Debug check failed: success || old_payload.HasMarkBitSet().
#
#
#
#FailureMessage Object: 0x714986ffc490
==== C stack trace ===============================
/home/rjlothian_google_com/chromium/src/out/Default/libv8_libbase.so(v8::base::debug::StackTrace::StackTrace()+0x1e) [0x7149d512dfce]
/home/rjlothian_google_com/chromium/src/out/Default/libv8_libplatform.so(+0x1644d) [0x7149d50b644d]
/home/rjlothian_google_com/chromium/src/out/Default/libv8_libbase.so(V8_Fatal(char const*, int, char const*, ...)+0x194) [0x7149d51100e4]
/home/rjlothian_google_com/chromium/src/out/Default/libv8_libbase.so(+0x50995) [0x7149d510f995]
/home/rjlothian_google_com/chromium/src/out/Default/libv8.so(+0x25ea33d) [0x7149d772333d]
/home/rjlothian_google_com/chromium/src/out/Default/libv8.so(+0x25ea231) [0x7149d7723231]
/home/rjlothian_google_com/chromium/src/out/Default/libv8.so(v8::internal::ConcurrentMarking::RunMajor(v8::JobDelegate*, v8::base::EnumSet<v8::internal::CodeFlushMode, int>, unsigned int, bool)+0x6c5) [0x7149d76ee135]
/home/rjlothian_google_com/chromium/src/out/Default/libv8.so(+0x25c6722) [0x7149d76ff722]
/home/rjlothian_google_com/chromium/src/out/Default/libv8_libplatform.so(+0x146a3) [0x7149d50b46a3]
/home/rjlothian_google_com/chromium/src/out/Default/libv8_libplatform.so(v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run()+0xc3) [0x7149d50b7a43]
/home/rjlothian_google_com/chromium/src/out/Default/libv8_libbase.so(+0x6d671) [0x7149d512c671]
/lib/x86_64-linux-gnu/libc.so.6(+0x9caa4) [0x7149d3deeaa4]
/lib/x86_64-linux-gnu/libc.so.6(__clone+0x44) [0x7149d3e7ba64]
Overview: A data race exists between the garbage collector's Mark() method and the mutator's Publish() or Unpublish() operations on a TrustedPointerTableEntry. This race can cause a live entry's mark bit to be dropped, leading to premature freeing during the sweep phase. Exploiting this results in a Use-After-Free and Object Confusion within V8's Trusted Space.
Affected files:
v8/src/sandbox/trusted-pointer-table-inl.h
Estimated timestamp from git blame: Unknown (Google3 checkout)
Root Cause
A race condition in v8/src/sandbox/trusted-pointer-table-inl.h allows a concurrent mutator to accidentally clear or prevent the setting of the garbage collector's mark bit on a TrustedPointerTableEntry.
The Mark() function attempts to set the mark bit using a non-looping compare_exchange_strong. It incorrectly assumes that any CAS failure implies another thread has already set the mark bit:
void TrustedPointerTableEntry::Mark() {
auto old_payload = payload_.load(std::memory_order_relaxed);
auto new_payload = old_payload;
new_payload.SetMarkBit();
bool success = payload_.compare_exchange_strong(old_payload, new_payload,
std::memory_order_relaxed);
DCHECK(success || old_payload.HasMarkBitSet());
USE(success);
}
Concurrently, the Publish() and Unpublish() methods modify the entry's tag using a simple store operation:
void TrustedPointerTableEntry::Unpublish() {
auto old_payload = payload_.load(std::memory_order_relaxed);
auto new_payload = old_payload;
new_payload.SetTag(kUnpublishedIndirectPointerTag);
payload_.store(new_payload, std::memory_order_release);
}
If Publish() or Unpublish() execute concurrently with Mark(), two race scenarios lead to an unmarked entry:
- CAS Failure: If the tag is modified between
Mark()'sloadandcompare_exchange_strong, the CAS fails. SinceMark()does not loop, the entry remains unmarked. - Bit Overwrite: If
Mark()succeeds first, the concurrentstoreinPublish()/Unpublish()will blindly overwrite the payload using the olderold_payloadvalue (which does not have the mark bit set), effectively erasing the mark bit.
During the subsequent sweep phase, the GC considers the entry unmarked and moves it to the freelist. If the old handle remains accessible (e.g., via stale pointers on the stack or in the sandbox), it can be used to access whatever new trusted object re-allocates that freelist entry, resulting in Use-After-Free and Object Confusion within V8's Trusted Space.
Suggested Fix
Update operations that modify the TrustedPointerTableEntry payload to use a compare_exchange_weak loop to ensure they preserve concurrently updated bits.
For Mark():
void TrustedPointerTableEntry::Mark() {
auto old_payload = payload_.load(std::memory_order_relaxed);
while (!old_payload.HasMarkBitSet()) {
auto new_payload = old_payload;
new_payload.SetMarkBit();
if (payload_.compare_exchange_weak(old_payload, new_payload, std::memory_order_relaxed)) {
break;
}
}
}
Similarly, Publish() and Unpublish() should be refactored to use a CAS loop instead of a direct store to avoid overwriting a concurrently set mark bit.
Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb
The description of the vuln is LLM-generated and can contain mistakes. Your feedback is appreciated, and will help us make improvement over time. The PoC was run in a VM and it seemed to be legit - if not, let us know and we can strengthen our checker. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
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
The Mark() function uses a non-looping compare_exchange_strong and assumes any failure means the mark bit is already set, while Publish() and Unpublish() use a plain store that can overwrite a concurrently set mark bit.
Impact
This race can cause a live entry's mark bit to be dropped, leading to premature freeing during the sweep phase, resulting in a Use-After-Free and Object Confusion within V8's Trusted Space.
What the attacker needed
Ability to trigger concurrent GC and mutator operations
The fix
The fix should update Mark(), Publish(), and Unpublish() to use compare_exchange_weak loops to preserve concurrently updated bits.
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 in Chrome. It uses a garbage collector to free memory that is no longer needed. A race condition happens when two parts of the program try to change the same data at the same time without proper coordination. Here, the garbage collector and another part of the program can both modify a marker bit, and the bit can get lost, so the garbage collector frees memory that is still in use. This can let an attacker reuse that freed memory for something else, potentially leading to further exploitation.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.