Type Confusion in V8 (CVE-2024-5833)
A debug assertion in V8's Turboshaft WebAssembly GC type analyser fails when merging types, indicating an incomplete fix for an earlier type confusion issue. The reporter shows a crash in a debug build but does not demonstrate exploitable memory corruption.
Originally disclosed on Chrome VRP
- Fix shipped in 19 days
Security Bug
Important: Please do not change the component of this bug manually.
Please READ THIS FAQ before filing a bug: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/security/faq.md
Please see the following link for instructions on filing security bugs: https://www.chromium.org/Home/chromium-security/reporting-security-bugs
Reports may be eligible for reward payments under the Chrome VRP: https://g.co/chrome/vrp
NOTE: Security bugs are normally made public once a fix has been widely deployed.
VULNERABILITY DETAILS
Similar to issue https://issues.chromium.org/issues/324747822, I think the fix is not complete.
VERSION
Chrome Version: V8 version 12.7.0 (candidate)
Operating System: Linux64
REPRODUCTION CASE
- Download latest d8-component on
gs://v8-asan/linux-debug/d8-linux-debug-v8-component-94084.zip - run with
./d8 helper2.js --future --jit-fuzzing /path/original.wasm
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
#
# Fatal error in ../../src/compiler/turboshaft/wasm-gc-typed-optimization-reducer.cc, line 405
# Debug check failed: !type.is_uninhabited().
#
#
#
#FailureMessage Object: 0x7dace67f99f0
==== C stack trace ===============================
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8_libbase.so(v8::base::debug::StackTrace::StackTrace()+0x13) [0x7dad22afbe53]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8_libplatform.so(+0x18e3d) [0x7dad1d5f3e3d]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8_libbase.so(V8_Fatal(char const*, int, char const*, ...)+0x17d) [0x7dad22add04d]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8_libbase.so(+0x2ba95) [0x7dad22adca95]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::compiler::turboshaft::WasmGCTypeAnalyzer::CreateMergeSnapshot(v8::base::Vector<v8::internal::compiler::turboshaft::SnapshotTable<v8::internal::wasm::ValueType, v8::internal::compiler::turboshaft::NoKeyData>::Snapshot const>, v8::base::Vector<bool const>)+0x5c8) [0x7dad21f153c8]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::compiler::turboshaft::WasmGCTypeAnalyzer::Run()+0x31c) [0x7dad21f1489c]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(void v8::internal::compiler::turboshaft::GraphVisitor<v8::internal::compiler::turboshaft::ReducerStack<v8::internal::compiler::turboshaft::Assembler<v8::internal::compiler::turboshaft::reducer_list<v8::internal::compiler::turboshaft::TurboshaftAssemblerOpInterface, v8::internal::compiler::turboshaft::GraphVisitor, v8::internal::compiler::turboshaft::WasmLoadEliminationReducer, v8::internal::compiler::turboshaft::WasmGCTypedOptimizationReducer, v8::internal::compiler::turboshaft::TSReducerBase>>, false, v8::internal::compiler::turboshaft::WasmLoadEliminationReducer, v8::internal::compiler::turboshaft::WasmGCTypedOptimizationReducer, v8::internal::compiler::turboshaft::TSReducerBase>>::VisitGraph<false>()+0x46) [0x7dad21ed7476]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::compiler::turboshaft::CopyingPhase<v8::internal::compiler::turboshaft::WasmLoadEliminationReducer, v8::internal::compiler::turboshaft::WasmGCTypedOptimizationReducer>::Run(v8::internal::compiler::turboshaft::PipelineData*, v8::internal::Zone*)+0x105) [0x7dad21ec50e5]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::compiler::turboshaft::WasmGCOptimizePhase::Run(v8::internal::compiler::turboshaft::PipelineData*, v8::internal::Zone*)+0x76) [0x7dad21ec4f56]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(auto v8::internal::compiler::turboshaft::Pipeline::Run<v8::internal::compiler::turboshaft::WasmGCOptimizePhase>()+0xda) [0x7dad21d6889a]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::compiler::Pipeline::GenerateWasmCodeFromTurboshaftGraph(v8::internal::OptimizedCompilationInfo*, v8::internal::wasm::CompilationEnv*, v8::internal::compiler::WasmCompilationData&, v8::internal::compiler::MachineGraph*, v8::internal::wasm::WasmFeatures*, v8::internal::compiler::CallDescriptor*)+0x677) [0x7dad21d671f7]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::compiler::turboshaft::ExecuteTurboshaftWasmCompilation(v8::internal::wasm::CompilationEnv*, v8::internal::compiler::WasmCompilationData&, v8::internal::wasm::WasmFeatures*)+0x2b1) [0x7dad21ff0631]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::wasm::WasmCompilationUnit::ExecuteFunctionCompilation(v8::internal::wasm::CompilationEnv*, v8::internal::wasm::WireBytesStorage const*, v8::internal::Counters*, v8::internal::wasm::WasmFeatures*)+0x67a) [0x7dad214e906a]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(v8::internal::wasm::WasmCompilationUnit::ExecuteCompilation(v8::internal::wasm::CompilationEnv*, v8::internal::wasm::WireBytesStorage const*, v8::internal::Counters*, v8::internal::wasm::WasmFeatures*)+0x140) [0x7dad214e85e0]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(+0x3f46f13) [0x7dad21546f13]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8.so(+0x3f46795) [0x7dad21546795]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8_libplatform.so(v8::platform::DefaultJobWorker::Run()+0xd3) [0x7dad1d5f2be3]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8_libplatform.so(v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run()+0xcc) [0x7dad1d5f501c]
/home/rheza/prebuild_chromium/v8/d8-linux-debug-v8-component-94084/libv8_libbase.so(+0x49b98) [0x7dad22afab98]
/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7dad1ce94ac3]
/lib/x86_64-linux-gnu/libc.so.6(+0x126850) [0x7dad1cf26850]
Trace/breakpoint trap (core dumped)
Bisect
Maybe similar from https://crrev.com/3f2471d0abe711c92ddb3d6fe17bc22d9955f2b8
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 WebAssembly GC typed optimisation reducer creates a merge snapshot containing an uninhabited type, meaning the earlier fix for the related issue did not cover all paths.
Impact
The debug build aborts on a failed type check; the report does not show whether a release build could be exploited for memory corruption.
What the attacker needed
Debug d8 build; crafted wasm module
How it was found
- Download the provided debug d8 build for the V8 component.
- Run d8 with the helper script, the future flag, jit-fuzzing and the original wasm file.
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 inside Chrome. It compiles WebAssembly (a fast binary format for the web) and tries to reason about the types of values; here that reasoning hit an impossible type and the debug build stopped with an error. The report only shows a crash in a special debug build, not proof that an attacker could take over a browser.
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.