Out of bounds memory access in V8 (CVE-2025-0434)
A crafted JavaScript file triggers a type confusion in V8's numeric conversion path, causing a debug check failure and an out-of-bounds memory access crash in the d8 shell. The report does not demonstrate what an attacker could achieve beyond crashing the engine.
- Fix shipped in 3 months
Steps to reproduce the problem
- download d8-asan-linux-debug-v8-component-96641
- unzip that
- run d8 ./poc.js
Problem Description
#
# Fatal error in ../../src/objects/objects.cc, line 353
# Debug check failed: Handle<To> v8::internal::Cast(Handle<From>, const v8::SourceLocation &) [To = v8::internal::JSReceiver, From = v8::internal::Object].
#
#
#
#FailureMessage Object: 0x7bc62e2f9c60
==== C stack trace ===============================
./google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/d8(__interceptor_backtrace+0x46) [0x55cbd91b17a6]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8_libbase.so(v8::base::debug::StackTrace::StackTrace()+0x13) [0x7fc6317c8573]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8_libplatform.so(+0x3687a) [0x7fc63171c87a]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8_libbase.so(V8_Fatal(char const*, int, char const*, ...)+0x2a0) [0x7fc631792c80]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8_libbase.so(+0x56d3f) [0x7fc631791d3f]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8.so(v8::internal::Handle<v8::internal::JSReceiver> v8::internal::Cast<v8::internal::JSReceiver, v8::internal::Object>(v8::internal::Handle<v8::internal::Object>, v8::SourceLocation const&)+0x1b2) [0x7fc635ba53f2]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8.so(v8::internal::Object::ConvertToNumeric(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>)+0x1ba) [0x7fc637bd9dba]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8.so(v8::internal::Object::ToNumeric(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>)+0x3d1) [0x7fc635aacda1]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8.so(+0x6acfa0d) [0x7fc6382b3a0d]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8.so(v8::internal::Runtime_ToNumeric(int, unsigned long*, v8::internal::Isolate*)+0x1da) [0x7fc6382b315a]
/root/google-cloud-sdk/d8-asan-linux-debug-v8-component-96641/libv8.so(+0x3a58afd) [0x7fc63523cafd]
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1914346==ERROR: AddressSanitizer: TRAP on unknown address 0x000000000000 (pc 0x7fc6317c3690 bp 0x7ffe27e76810 sp 0x7ffe27e76810 T0)
SCARINESS: 10 (signal)
#0 0x7fc6317c3690 in v8::base::OS::Abort() src/base/platform/platform-posix.cc:730:7
#1 0x7fc631792c9b in V8_Fatal(char const*, int, char const*, ...) src/base/logging.cc:215:3
#2 0x7fc631791d3e in v8::base::(anonymous namespace)::DefaultDcheckHandler(char const*, int, char const*) src/base/logging.cc:59:3
#3 0x7fc635ba53f1 in v8::internal::Handle<v8::internal::JSReceiver> v8::internal::Cast<v8::internal::JSReceiver, v8::internal::Object>(v8::internal::Handle<v8::internal::Object>, v8::SourceLocation const&) src/handles/handles-inl.h:50:3
#4 0x7fc637bd9db9 in v8::internal::Object::ConvertToNumeric(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>) src/objects/objects.cc:350:5
#5 0x7fc635aacda0 in v8::internal::Object::ToNumeric(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>) src/objects/objects-inl.h:816:10
#6 0x7fc6382b3a0c in v8::internal::__RT_impl_Runtime_ToNumeric(v8::internal::Arguments<(v8::internal::ArgumentsType)0>, v8::internal::Isolate*) src/runtime/runtime-object.cc:1231:3
#7 0x7fc6382b3159 in v8::internal::Runtime_ToNumeric(int, unsigned long*, v8::internal::Isolate*) src/runtime/runtime-object.cc:1227:1
#8 0x7fc63523cafc in Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit setup-isolate-deserialize.cc
#9 0x7fc635454701 in Builtins_NonNumberToNumeric setup-isolate-deserialize.cc
#10 0x7fc6358490d4 in Builtins_ShiftRightLogicalHandler setup-isolate-deserialize.cc
#11 0x7fc634e5754e in Builtins_InterpreterEntryTrampoline setup-isolate-deserialize.cc
#12 0x7fc634e58162 in Builtins_InterpreterPushArgsThenFastConstructFunction setup-isolate-deserialize.cc
#13 0x7fc63587725c in Builtins_ConstructHandler setup-isolate-deserialize.cc
#14 0x7fc634e5754e in Builtins_InterpreterEntryTrampoline setup-isolate-deserialize.cc
#15 0x7fc634e4e5db in Builtins_JSEntryTrampoline setup-isolate-deserialize.cc
#16 0x7fc634e4e31e in Builtins_JSEntry setup-isolate-deserialize.cc
#17 0x7fc63659536a in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) src/execution/simulator.h:191:12
#18 0x7fc63659903c in v8::internal::Execution::CallScript(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) src/execution/execution.cc:517:10
#19 0x7fc635a5b263 in v8::Script::Run(v8::Local<v8::Context>, v8::Local<v8::Data>) src/api/api.cc:2140:7
#20 0x55cbd927e335 in v8::Shell::ExecuteString(v8::Isolate*, v8::Local<v8::String>, v8::Local<v8::String>, v8::Shell::ReportExceptions, v8::Global<v8::Value>*)
Summary
Type Confusion in ConvertToNumeric
Custom Questions
Type of crash:
tab
Additional Data
Category: Security
Chrome Channel: Not sure
Regression: N/A
What the report shows
This is a Chrome VRP report against V8, the JavaScript engine used by Chrome. The researcher, ddme, reported an out of bounds memory access that the platform later tracked as CVE-2025-0434, rated high severity, with a bounty of 7,000 USD and disclosure on 14 January 2025. The report itself is short: a reproduction recipe, a crash dump and a one line summary.
The reproduction steps are exactly these:
- Download the build
d8-asan-linux-debug-v8-component-96641. - Unzip it.
- Run the proof of concept against the shell:
run d8 ./poc.js
The proof of concept file itself is not included in the text, so the exact JavaScript that triggers the crash is not shown here.
Running it produces a fatal debug check failure in ../../src/objects/objects.cc at line 353. The failing check is a cast from Object to JSReceiver:
# Fatal error in ../../src/objects/objects.cc, line 353
# Debug check failed: Handle<To> v8::internal::Cast(Handle<From>, const v8::SourceLocation &) [To = v8::internal::JSReceiver, From = v8::internal::Object].
The stack trace shows the path that leads to the failure. The relevant frames are:
After the fatal check, AddressSanitizer reports a trap on address 0x000000000000 with a scariness score of 10, After the fatal check, AddressSanitizer reports a trap on address 0x000000000000 with a scariness score of 10.. The researcher's summary names the bug class directly: type confusion in ConvertToNumeric. The custom question on crash type is answered with tab, and the additional data records the category as Security, the Chrome channel as not sure and regression as N/A.
The report does not describe a fix, a patch or the affected version beyond the build name above.
Root cause
The crash happens when a value reaches the numeric conversion path through a logical shift right operation. Builtins_ShiftRightLogicalHandler calls Builtins_NonNumberToNumeric, which enters Runtime_ToNumeric, then Object::ToNumeric and Object::ConvertToNumeric. Inside ConvertToNumeric, the code casts the input handle to JSReceiver with a debug check. The check fails, which means the object at that point is not the kind of receiver the code expects.
The report does not identify the root cause beyond the summary naming type confusion in ConvertToNumeric. The report does not identify the specific optimisation or object shape that produces the mismatch.
Impact
In the debug build the outcome is a controlled abort, which is a denial of service at most. The issue is classified as an out of bounds memory access, but the report itself only shows the debug check failure. The report does not demonstrate code execution, a sandbox escape or any exploitation beyond the crash, so the practical impact beyond memory corruption is not established here.
How this kind of bug works
A type confusion occurs when code believes an object has one representation but the object actually has another. Engines like V8 use hidden internal types and inline caches to skip checks on hot paths. When an operation such as a bitwise shift sees a value that is not a number, it falls back to a slower runtime routine that converts the value to a numeric primitive. If the fast path and the slow path disagree about what the value is, or if a map transition changes the object between the check and the use, the conversion routine can read fields at the wrong offsets.
Out of bounds access follows naturally: the code computes a field offset for the expected type and reads or writes memory that belongs to a different layout. Defences include keeping the check and the use consistent, re-checking the map after any operation that can run user code, and using representations that cannot be confused, such as tagged pointers with explicit type tags. Debug builds add cast checks precisely to catch these mismatches early, which is why this report surfaced as a fatal check rather than a silent corruption.
How to test for it
- Target the engine's conversion and arithmetic paths: bitwise operators,
ToNumber,ToNumeric,valueOfandSymbol.toPrimitivehooks, and any operation that mixes objects with numbers. - Build or obtain a debug or sanitizer build of the engine, since the checks that turn a silent confusion into a visible failure are usually compiled out of release builds.
- Write small scripts that pass objects with unusual shapes into these operations, including objects whose prototype or conversion hooks change during the operation, and objects created through constructors with modified prototypes.
- Run each case under the sanitizer build and watch for cast check failures, assertion failures or sanitizer reports. A positive result is a deterministic crash with a stack trace pointing at a conversion or cast routine.
- Minimise the script until only the operations needed for the crash remain, then confirm it still crashes on a fresh run.
Common false positives are crashes caused by the test harness itself, by unsupported syntax in the shell, or by known and already fixed issues in old builds. A crash that only appears once and cannot be reproduced with a minimised script is not a finding. Always check the build revision against the project's issue tracker before reporting.
How it is fixed
Hunting notes
This class of bug tends to hide in engine internals rather than in application code: numeric conversion, comparison operators, property access on exotic objects, and any path where a fast builtin hands off to a runtime function. Recon signals include recent changes to builtins or runtime conversion code, fuzzer findings in the same area, and crashes that only reproduce on debug or sanitizer builds.
What happened, in plain words
Chrome runs JavaScript using its own engine, called V8. Think of V8 as the translator that turns the code on a web page into instructions the computer can carry out. If that translator can be tricked into misreading something, the consequences can reach beyond a single web page.
A security researcher, ddme, reported a bug in V8 through Google's Chrome Vulnerability Reward Program (VRP), a scheme that pays people for finding and reporting security flaws. The platform tracked the issue as CVE-2025-0434, rated it high severity, paid a bounty of 7,000 USD and disclosed it on 14 January 2025. The report itself is short: a recipe to reproduce the crash, the crash output, and a one line summary.
The reproduction steps are exactly these:
- Download the build
d8-asan-linux-debug-v8-component-96641. - Unzip it.
- Run the proof of concept against the shell:
run d8 ./poc.js
d8 is V8's own command line program: instead of a browser, you give it a JavaScript file and it runs it. The build name tells you it is a debug build with AddressSanitizer (ASan), a tool that watches memory use and shouts when something goes wrong. Debug builds keep extra internal checks that normal release builds remove, which is why this bug showed up as a loud failure rather than silent damage. The proof of concept file itself is not included in the text, so the exact JavaScript that triggers the crash is not shown.
Running it produces a fatal debug check failure in ../../src/objects/objects.cc at line 353. The failing check is a cast from Object to JSReceiver:
# Fatal error in ../../src/objects/objects.cc, line 353
# Debug check failed: Handle<To> v8::internal::Cast(Handle<From>, const v8::SourceLocation &) [To = v8::internal::JSReceiver, From = v8::internal::Object].
In plain terms: V8 has many internal kinds of value, and a cast is code saying "I am sure this thing is of kind X". Here the code insisted an object was a JSReceiver (roughly, something that can receive properties and calls, like a JavaScript object) when it was only a generic Object. The debug check failed and the program stopped.
The stack trace shows the path that leads to the failure. Read from the JavaScript side upwards, the interesting frames are:
Each line is one step in a chain. A logical shift right (a bitwise operation, >>> in JavaScript) reached a builtin, one of V8's pre-written fast routines. Because the value was not a number, the builtin handed off to NonNumberToNumeric, which entered the runtime function Runtime_ToNumeric, then Object::ToNumeric and Object::ConvertToNumeric. Inside that last function the cast failed.
After the fatal check, AddressSanitizer reports a trap on address 0x000000000000 with a scariness score of 10. AddressSanitizer reports a trap on address 0x000000000000 with a scariness score of 10. The researcher's summary names the bug class directly: type confusion in ConvertToNumeric. The custom question on crash type is answered with tab, and the additional data records the category as Security, the Chrome channel as not sure and regression as N/A. The report does not describe a fix, a patch or the affected version beyond the build name above.
In general, how this kind of bug works
A type confusion happens when code believes an object has one shape but the object actually has another. A useful comparison is a post office clerk who is told a parcel contains a book, opens it expecting pages, and finds a glass vase. The clerk's actions were correct for a book and wrong for a vase.
V8 stores values with hidden internal types and uses shortcuts (inline caches) to skip checks on frequently used paths. When an operation such as a bitwise shift sees a value that is not a number, it falls back to a slower routine that converts the value to a number. If the fast path and the slow path disagree about what the value is, or if the object changes shape between the check and the use, the conversion routine can read fields at the wrong offsets.
Out of bounds access follows naturally: the code computes a field offset for the expected type and reads or writes memory that belongs to a different layout. Defences include keeping the check and the use consistent, re-checking the type after any operation that can run user code, and using representations that cannot be confused. Debug builds add cast checks precisely to catch these mismatches early, which is why this report surfaced as a fatal check rather than silent corruption.
The report does not identify the specific optimisation or object shape that produces the mismatch.
In general, how to test for it
- Target the engine's conversion and arithmetic paths: bitwise operators,
ToNumber,ToNumeric,valueOfandSymbol.toPrimitivehooks, and any operation that mixes objects with numbers. - Build or obtain a debug or sanitizer build of the engine, since the checks that turn a silent confusion into a visible failure are usually compiled out of release builds.
- Write small scripts that pass objects with unusual shapes into these operations, including objects whose prototype or conversion hooks change during the operation, and objects created through constructors with modified prototypes.
- Run each case under the sanitizer build and watch for cast check failures, assertion failures or sanitizer reports. A positive result is a deterministic crash with a stack trace pointing at a conversion or cast routine.
- Minimise the script until only the operations needed for the crash remain, then confirm it still crashes on a fresh run.
Common false positives are crashes caused by the test harness itself, by unsupported syntax in the shell, or by known and already fixed issues in old builds. A crash that only appears once and cannot be reproduced with a minimised script is not a finding. Always check the build revision against the project's issue tracker before reporting.
In general, how it is fixed
In general, where to hunt
This class of bug tends to hide in engine internals rather than in application code: numeric conversion, comparison operators, property access on exotic objects, and any path where a fast builtin hands off to a runtime function. Recon signals include recent changes to builtins or runtime conversion code, fuzzer findings in the same area, and crashes that only reproduce on debug or sanitizer builds.
Glossary
- V8: the JavaScript engine inside Chrome that runs the code on web pages.
- Chrome VRP: Google's Vulnerability Reward Program, which pays researchers for reporting security bugs.
- CVE: a public identifier given to a known security vulnerability.
- Bounty: the money paid for a valid report.
- d8: V8's command line shell for running JavaScript files outside a browser.
- Debug build: a version of the software that keeps extra internal checks, used for finding bugs.
- AddressSanitizer (ASan): a tool that detects memory errors and reports them loudly.
- Proof of concept (PoC): a small script or file that reliably triggers a bug.
- Cast: code that asserts a value is of a particular internal type.
- JSReceiver: V8's internal category for objects that can hold properties and be called.
- Stack trace: the list of function calls that led to a crash, from the innermost call outwards.
- Builtin: a pre-written fast routine inside the engine.
- Runtime function: a slower internal function the engine falls back to when a fast path cannot handle a value.
- Bitwise shift: an operation that moves the bits of a number left or right;
>>>is a logical shift right. - Type confusion: a bug where code treats a value as one type when it is actually another.
- Out of bounds memory access: reading or writing memory outside the area the code is supposed to touch.
- Inline cache: a shortcut that remembers the type seen at a code location to skip repeated checks.
- Map: V8's internal description of an object's shape and layout.
- Regression test: a test added so a fixed bug cannot quietly return.
- Fuzzer: a tool that feeds many random inputs to software looking for crashes.