AddressSanitizer: global-buffer-overflow on NSS PORT_FreeArena_Util -> PL_ClearArenaPool after calloc and malloc failure
Originally disclosed on Mozilla
- Fixed in 11 months
- Paid in 12 months
- Disclosed after 11 months
Created attachment 9339911
asan-global-buffer-overflow-read-8.txt
When running `new RTCPeerConnection()` and fillMemory using JS code to exhaust the process virtual memory, on Firefox compiled with AddressSanitizer, I able to hit `AddressSanitizer: global-buffer-overflow`, sometimes it hit SEGV on unknown address, and sometimes "fault was caused by a dereference of a high value address" is included, it hit on NSS `PORT_FreeArena_Util` -> `PL_ClearArenaPool`, this one is quite rare to trigger on ASan, compared to Bug 1838197 is very common.
I've investigated for a days, it caused after calloc failure on [`ec_NewKey`](https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/ec.c#411) at [`mp_init(&k)`](https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/ec.c#293), the [`ec_NewKey`](https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/ec.c#411) is returning `ecPriv` value from calloc failure, then malloc failure on [`SEC_ASN1EncodeItem`](https://searchfox.org/mozilla-central/source/security/nss/lib/softoken/pkcs11c.c#5628) is triggered `goto ecgn_done;` which freed up the `ecPriv` on [`PORT_FreeArena(ecPriv->ecParams.arena, PR_TRUE);`](https://searchfox.org/mozilla-central/source/security/nss/lib/softoken/pkcs11c.c#5651)
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 medium-severity doS bug in Libraries. Mozilla made it public on 30 May 2024 as CVE-2024-6609.
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.