Type Confusion in V8 (CVE-2024-8638)
A type confusion in V8's WebAssembly JavaScript Promise Integration (JSPI) caused a debug check failure when compiling a WebAssembly module. An attacker could potentially exploit this to cause a crash or possibly achieve code execution.
Originally disclosed on Chrome VRP
- Fix shipped in 14 days
VULNERABILITY DETAILS
INTRODUCE
After bisect, it was determined that following commit caused this problem.
- Commit Info
- Version: 92983
- link: https://crrev.com/0c2b15100d997a8f1b74fcc448da319c75f2e045
- Commit Message
commit 0c2b15100d997a8f1b74fcc448da319c75f2e045
Author: Adam Klein <[email protected]>
Date: Thu Mar 21 13:36:59 2024 -0700
[wasm][jspi][d8] Add ability to test runtime-enabling of JSPI
This adds an `enableJSPI` function to the d8 test runner which
allows simulating the way the JSPI Origin Trial in Chrome enables JSPI.
Then it makes a copy of the JSPI mjsunit test to use this approach,
rather than using a commandline flag.
Bug: v8:14576
Change-Id: I637972dcf7de288d42b1325355b08c6b1b86d9ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5385244
Reviewed-by: Francis McCabe <[email protected]>
Commit-Queue: Adam Klein <[email protected]>
Cr-Commit-Position: refs/heads/main@{#92983}
CRASH LOG
- Debug output
# CMD: /tmp/d8-linux-debug-v8-component-95842/d8 --allow-natives-syntax --jit-fuzzing poc.js
# OUTPUT ==============================================================
#
# Fatal error in ../../src/objects/shared-function-info-inl.h, line 911
# Debug check failed: HasWasmExportedFunctionData().
#
#
#
#FailureMessage Object: 0x7ffd2b60ead0
==== C stack trace ===============================
/tmp/d8-linux-debug-v8-component-95842/libv8_libbase.so(v8::base::debug::StackTrace::StackTrace()+0x13) [0x7f831d74b153]
/tmp/d8-linux-debug-v8-component-95842/libv8_libplatform.so(+0x199ed) [0x7f831d6f39ed]
/tmp/d8-linux-debug-v8-component-95842/libv8_libbase.so(V8_Fatal(char const*, int, char const*, ...)+0x194) [0x7f831d72c854]
/tmp/d8-linux-debug-v8-component-95842/libv8_libbase.so(+0x2c265) [0x7f831d72c265]
/tmp/d8-linux-debug-v8-component-95842/libv8.so(v8::internal::SharedFunctionInfo::wasm_exported_function_data(v8::internal::PtrComprCageBase) const+0xa3) [0x7f831a87b143]
/tmp/d8-linux-debug-v8-component-95842/libv8.so(+0x3ffb012) [0x7f831bdfb012]
/tmp/d8-linux-debug-v8-component-95842/libv8.so(+0x3fda1fb) [0x7f831bdda1fb]
/tmp/d8-linux-debug-v8-component-95842/libv8.so(v8::internal::Runtime_WasmCompileWrapper(int, unsigned long*, v8::internal::Isolate*)+0x90) [0x7f831bdd9a30]
/tmp/d8-linux-debug-v8-component-95842/libv8.so(+0x1f65dd7) [0x7f8319d65dd7]
Other
Please note to include the flags --allow-natives-syntax --jit-fuzzing for clusterfuzz classification.
VERSION Tested on v8 version: 12.5.0 - 13.0.0
REPRODUCTION CASE
- Download debug v8 from: gs://v8-asan/linux-debug/d8-linux-debug-v8-component-95842.zip
- Run:
d8 --allow-natives-syntax --jit-fuzzing poc.js
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION Type of crash: tab
CREDIT INFORMATION Reporter credit: Zhenghang Xiao (@Kipreyyy)
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
Impact
The vulnerability could cause a crash and potentially lead to remote code execution, though the report only demonstrates a debug assertion failure.
What the attacker needed
Ability to run JavaScript in V8
How it was found
- Download the debug build of V8.
- Run the provided poc.js with the flags --allow-natives-syntax --jit-fuzzing.
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 in Chrome. A type confusion bug means the engine treats one kind of data as another, which can lead to crashes or worse. This report shows a crash in a debug build, but the underlying flaw could be serious.
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.