Skip to content
Memory corruption Advisory Advanced CVE-2020-12418

Mozilla Firefox URL mPath Information Disclosure Vulnerability

A crafted sequence of assignments to a URL object's search, host and pathname properties can make an internal length field negative, so a later search assignment copies memory from beyond the URL string. An attacker could leak browser memory, which may help bypass ASLR and, combined with another flaw, lead to code execution.

Marcin 'Icewall' Noga Follow

Originally disclosed on Cisco Talos

Medium 6.5 View original

An information disclosure vulnerability exists in the URL mPath functionality of Mozilla Firefox Firefox Nightly Version 78.0a1 x64 and Firefox Release Version 76.0.2 x64. A specially crafted URL object can cause an out-of-bounds read.

Marcin 'Icewall' Noga, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

Root cause

Likely a negative path length caused by a query-string shrink is not handled, so the shift routine skips updating the path position and a later copy reads out of bounds.

Impact

A malicious page could leak browser memory, which may help bypass ASLR and, combined with another vulnerability, could allow arbitrary code execution.

What the attacker needed

Victim visits a malicious webpage; JavaScript enabled in Firefox

How it was found

  1. Create a URL object for a normal web address.
  2. Set a long search string and then a long host string.
  3. Set the pathname to an empty string.
  4. Set a short search string, which makes the internal path length negative.
  5. Set a short host string; the path position is not updated.
  6. Set another search string to trigger the out-of-bounds read and leak memory.

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.

A web browser stores a web address in a structured object with separate parts for the host, path and query string. By changing those parts in a particular order, a script can confuse the browser about where the path starts, so it reads past the end of the address and exposes whatever memory lies next. That leaked memory can help an attacker defeat a defence called ASLR, which randomises memory locations to make exploitation harder.

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 Marcin 'Icewall' Noga

View all

146 more disclosed reports, best first.

More from Cisco Talos

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.