Skip to content
DoS Disclosed report Advanced

UBSan undefined-behavior error: addition of unsigned offset overflowed or Assertion failure: aIndex < mLength, at dist/include/mozilla/Vector.h:585

Gary Kwong Follow

Originally disclosed on Mozilla

  • Fixed in 6 days
  • Paid in 7 days
  • Disclosed after 6 days
Text
Created attachment 9471546
debug stack

'''js
function f() {
  Error.captureStackTrace(f, f);
}
bindToAsyncStack(f, { stack: saveStack() })();
'''

'''
(gdb) bt
#0  0x00005555576c6d4d in MOZ_CrashSequence (aAddress=0x0, aLine=585) at /home/ubu32gx500/shell-cache/js-dbg-64-linux-x86_64-99f5fa3c8fdf/objdir-js/dist/include/mozilla/Assertions.h:267
#1  mozilla::Vector<js::SavedFrame::Lookup, 60ul, js::TempAllocPolicy>::operator[] (this=0x7fffffffbcd8, aIndex=<optimized out>) at /home/ubu32gx500/shell-cache/js-dbg-64-linux-x86_64-99f5fa3c8fdf/objdir-js/dist/include/mozilla/Vector.h:585
#2  JS::GCVector<js::SavedFrame::Lookup, 60ul, js::TempAllocPolicy>::operator[] (this=0x7fffffffbcd8, i=<optimized out>) at /home/ubu32gx500/shell-cache/js-dbg-64-linux-x86_64-99f5fa3c8fdf/objdir-js/dist/include/js/GCVector.h:71
#3  js::MutableWrappedPtrOperations<JS::GCVector<js::SavedFrame::Lookup, 60ul, js::TempAllocPolicy>, JS::Rooted<JS::GCVector<js::SavedFrame::Lookup, 60ul, js::TempAllocPolicy> > >::operator[] (this=0x7fffffffbcc0, aIndex=<optimized out>) at /home/ubu32gx500/shell-cache/js-dbg-64-linux-x86_64-99f5fa3c8fdf/objdir-js/dist/include/js/GCVector.h:258
#4  js::SavedStacks::insertFrames (this=0x7ffff6498e70, cx=0x7ffff6f3a200, frame=..., capture=..., startAtObj=startAtObj@entry=...) at /home/ubu32gx500/trees/mozilla-central/js/src/vm/SavedStacks.cpp:1626
#5  0x00005555576c51de in js::SavedStacks::saveCurrentStack (this=<optimized out>, cx=<optimized out>, frame=..., capture=..., startAt=...) at /home/ubu32gx500/trees/mozilla-central/js/src/vm/SavedStacks.cpp:1339
/snip
'''

This seems related to https://hg.mozilla.org/integration/autoland/rev/5fdd7a5d986dbf8742e762f09d8ae7475aea0455 which shipped `Error.captureStackTrace` and is likely related to bug 1886820 when run with additional runtime flag `--setpref=experimental.error_capture_stack_trace=true`.

Run with `--fuzzing-safe --no-threads --no-baseline --no-ion`, compile with `AR=ar sh ../configure --enable-debug --enable-debug-symbols --with-ccache --enable-nspr-build --enable-ctypes --enable-gczeal --enable-rust-simd --disable-tests`, tested on m-c rev 99f5fa3c8fdf.

Matt, is bug 1886820 a likely regressor?

The original report as published on Mozilla's Bugzilla, by Gary Kwong. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A low-severity doS bug in JavaScript Engine. Mozilla made it public on 18 March 2025.

About DoS

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Gary Kwong

View all

42 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.