Skip to content
Memory corruption Disclosed report Advanced CVE-2023-6859

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.

Irvan Kurniawan Follow

Originally disclosed on Mozilla

  • Fixed in 5 months
  • Paid in 5 months
  • Disclosed after 5 months
Text
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)

The original report as published on Mozilla's Bugzilla, by Irvan Kurniawan. 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.

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

  1. Launch Firefox with --disable-e10s and fillMemory code.
  2. Contact a URL.
  3. 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.

More by Irvan Kurniawan

View all

72 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.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.