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.
Originally disclosed on Cisco Talos
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.
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
- Create a URL object for a normal web address.
- Set a long search string and then a long host string.
- Set the pathname to an empty string.
- Set a short search string, which makes the internal path length negative.
- Set a short host string; the path position is not updated.
- 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.