SEGV WRITE in __memcpy_avx_unaligned_erms via OrderedHashTableImpl::rehash
Originally disclosed on Mozilla
- Fixed in 3 days
- Paid in 8 days
- Disclosed after 3 days
Created attachment 9492361
poc.js
Run: ./objdir/dist/bin/js poc.js
'''
AddressSanitizer:DEADLYSIGNAL
=================================================================
==5142==ERROR: AddressSanitizer: SEGV on unknown address 0x7b44f55c87f0 (pc 0x7b44b1588a6c bp 0x7fffed2fb090 sp 0x7fffed2fa848 T0)
==5142==The signal is caused by a WRITE memory access.
/home/user/Desktop/firefox/objdir/dist/bin/llvm-symbolizer: error: '[anon:js-executable-memory]': No such file or directory
#0 0x7b44b1588a6c in __memcpy_avx_unaligned_erms string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:344
#1 0x55e9edcea82b in __asan_memcpy /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:63:3
#2 0x55e9edf86a1b in js::detail::OrderedHashTableImpl<js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::Entry, js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::MapOps>::rehash(JSContext*, unsigned int) /home/user/Desktop/firefox/js/src/builtin/OrderedHashTableObject.h:1222:13
#3 0x55e9edf85b64 in js::detail::OrderedHashTableImpl<js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::Entry, js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::MapOps>::rehashOnFull(JSContext*) /home/user/Desktop/firefox/js/src/builtin/OrderedHashTableObject.h:1181:12
#4 0x55e9edf85b64 in bool js::detail::OrderedHashTableImpl<js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::Entry, js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::MapOps>::put<js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::Entry>(JSContext*, js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::Entry&&) /home/user/Desktop/firefox/js/src/builtin/OrderedHashTableObject.h:717:52
#5 0x55e9edf70af9 in bool js::OrderedHashMapImpl<js::PreBarriered<js::HashableValue>, js::HeapPtr<JS::Value>, js::HashableValueHasher>::put<js::HashableValue const&, JS::Value const&>(JSContext*, js::HashableValue const&, JS::Value const&) /home/user/Desktop/firefox/js/src/builtin/OrderedHashTableObject.h:1357:17
#6 0x55e9edf4ed8e in js::MapObject::setWithHashableKey(JSContext*, js::HashableValue const&, JS::Value const&) /home/user/Desktop/firefox/js/src/builtin/MapObject.cpp:564:22
#7 0x55e9edf4ecdf in js::MapObject::set(JSContext*, JS::Value const&, JS::Value const&) /home/user/Desktop/firefox/js/src/builtin/MapObject.cpp:552:10
#8 0x7b442de13992 ([anon:js-executable-memory]+0x4992)
==5142==Register values:
rax = 0x00007b44f55c87f0 rbx = 0x0000000000000000 rcx = 0x00000f691eab10ff rdx = 0x0000000000000010
rdi = 0x00007b44f55c87f0 rsi = 0x00007b43875c07f8 rbp = 0x00007fffed2fb090 rsp = 0x00007fffed2fa848
r8 = 0x00000f689eab90fe r9 = 0x00007b44f55c87ff r10 = 0x00000f689eab90ff r11 = 0x00000f691eab10f8
r12 = 0x00000f691eab10f8 r13 = 0xffffffffffffffcf r14 = 0x00007fffed2fb268 r15 = 0x0000000020000000
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:344 in __memcpy_avx_unaligned_erms
==5142==ABORTING
========================================
'''
mozconfig:
'''
ac_add_options --enable-project=js
ac_add_options --enable-address-sanitizer
ac_add_options --disable-jemalloc
ac_add_options --disable-debug
ac_add_options --enable-optimize
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
'''
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 high-severity memory corruption bug in JavaScript Engine. Mozilla made it public on 6 June 2025 as CVE-2025-49710.
About 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.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
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.