AddressSanitizer: heap-use-after-free on PR_GetIdentitiesLayer after SSL_SetURL PORT_Strdup(url) allocation failure
A heap-use-after-free occurs in PR_GetIdentitiesLayer when the allocation of the URL string in SSL_SetURL fails. An attacker who can induce memory pressure could trigger a crash in Firefox.
Originally disclosed on Mozilla
- Fixed in 5 months
- Paid in 5 months
- Disclosed after 5 months
Created attachment 9340751
ssl-seturl-failure-heap-use-after-free-4.txt
When launching Firefox with `--disable-e10s` and fillMemory code, then when contacting with URL, at rare time Firefox able to crash with `AddressSanitizer: heap-use-after-free` on `PR_GetIdentitiesLayer`.
It happen when allocation failure on `SSL_SetURL` malloc at [`ss->url = (const char *)PORT_Strdup(url);`](https://searchfox.org/mozilla-central/source/security/nss/lib/ssl/sslsecur.c#1157)
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
Firefox could crash at rare times when memory allocation fails.
What the attacker needed
Firefox launched with --disable-e10s; Memory pressure (fillMemory code); Rare timing
How it was found
- Launch Firefox with --disable-e10s and fillMemory code.
- Contact a URL.
- At rare times, observe an AddressSanitizer heap-use-after-free on PR_GetIdentitiesLayer.
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.
When a program runs low on memory, some operations fail. Here, a failure to copy a web address left a pointer to memory that had already been freed, and later code used it. That can crash the browser.
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.