Skip to content
RCE Disclosed report Intermediate CVE-2018-18496

RCE potential by abusing embedded feed preview + click jacking

Firefox's embedded feed preview allows a user to choose a custom application to subscribe to a feed. By clickjacking the user into selecting a remote executable file via the file picker, an attacker can cause that file to be downloaded and executed, potentially leading to remote code execution.

Abdulrahman Alqabandi Follow

Originally disclosed on Mozilla

  • Fixed in 11 months
  • Paid in 11 months
  • Disclosed after 11 months
Text
Created attachment 8933553
feedrce.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce:

Tested on latest Nightly v59.0a1 (2017-11-30) (64-bit)

Using PoC attached:

1. Click on first button from the top, this will copy our malicious executable (in this case its my own hosted batch file that simply opens calc)
2. Click on the second button, you should see a drop down menu appear, here you choose the 'Choose Application..' option.
3. After a file picker appears, simply paste the URL copied in step1 and hit 'open'
4. Finally, click the last button.






Actual results:

Firefox has its own preview feed reader for files with the type "application/vnd.mozilla.maybe.feed". Within it, a user could choose a custom application to subscriber to the feed you're viewing. 

When choosing a custom app, a filepicker appears which we can feed an http url into it and after clicking 'open' the remote file will be downloaded into a local temporary folder. Finally, if the user clicks on the 'subscribe' button, the downloaded file will be executed.

In the PoC, we embed the feed preview in order to clickjack a potential victim into executing attacker executable file.
These files have mark of the web and so an initial 'unknown publisher' dialog warning does appear. Though we can bypass this by having a .jar file downloaded instead. Although its good that windows' mark of the web warnings appear for most executables, its not far fetched to bypass this with either a stolen cert or some bug in windows.


Expected results:

One or more of the following:

1. Disable feed preview on embedded feed files (or at least the part that allows custom apps).
2. Prevent file picker from downloading remote files (though this may be a windows unique problem)
3. Add whitelist of directories allowed to contain custom feed reader apps. (or blacklist temp web download folder)

Admittedly this requires high user interaction but keep in mind this highlights a bigger problem, that is that the feed previewer could be used for download&exec exploits. This can turn a uXSS into a full RCE. (I'm assuming here that if one can execute JS within feed preview pages, they could use it to 'fake' a custom app subscription which is essentially download&exec as described here)

The original report as published on Mozilla's Bugzilla, by Abdulrahman Alqabandi. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is Firefox's built-in feed preview, the reader that handles files of type application/vnd.mozilla.maybe.feed. The researcher tested on the latest Nightly at the time, v59.0a1 (2017-11-30) (64-bit), on Windows, and attached a proof of concept named feedrce.html.

The feature lets a user subscribe to the feed being viewed with a custom application. Choosing a custom app opens a file picker, and that picker accepts an HTTP URL. When the user clicks open, the remote file is downloaded into a local temporary folder. When the user then clicks subscribe, the downloaded file is executed.

The proof of concept embeds the feed preview so that a victim can be clickjacked into running an attacker-supplied executable. The steps, as given:

  1. Click the first button from the top, which copies a malicious executable. In the proof of concept this is a self-hosted batch file that simply opens the calculator.
  2. Click the second button. A drop-down menu appears; choose the Choose Application.. option.
  3. A file picker appears. Paste the URL copied in step 1 and hit open.
  4. Click the last button.

The researcher notes that these downloaded files carry the mark of the web, so an initial unknown publisher warning does appear. They suggest this can be bypassed by having a .jar file downloaded instead, and add that while the mark of the web warnings appear for most executables, bypassing them with a stolen certificate or a Windows bug is not far fetched.

The report proposes three possible fixes:

  1. Disable feed preview on embedded feed files, or at least the part that allows custom apps.
  2. Prevent the file picker from downloading remote files, though this may be a Windows-specific problem.
  3. Add a whitelist of directories allowed to contain custom feed reader apps, or blacklist the temporary web download folder.

The researcher is explicit that this requires high user interaction, and frames it as highlighting a bigger problem: the feed previewer could be used for download-and-execute exploits, which could turn a uXSS into a full RCE. That last point is stated as an assumption: if one can execute JavaScript within feed preview pages, one could use it to fake a custom app subscription, which is essentially the download-and-execute chain described.

Root cause

The report describes the flow rather than naming a root cause: the file picker accepts a remote HTTP URL as an application path, and the subscribe action executes the downloaded file. First, the file picker accepts a remote HTTP URL as an application path, so the browser downloads attacker-chosen content into a local temporary directory. Second, the subscribe action executes whatever was downloaded, without restricting which directories a custom feed reader may live in. Because the preview can be embedded, the whole flow can be driven by a clickjacked victim.

Impact

An attacker who can get a victim through the four interactions can execute a file of their choosing on the victim's machine. The mark of the web warning is a partial mitigation, and the report itself hedges on how reliably it can be bypassed. The report also hedges on the uXSS-to-RCE path, presenting it as an assumption rather than a demonstrated result.

How this kind of bug works

This is a download-and-execute chain reached through a trusted UI surface. The bug class appears when a browser feature that is supposed to launch a locally installed helper application accepts a location the attacker controls, and then runs what it finds there. Two properties make it work: the picker treats a URL as a valid application source, and the resulting file lands in a directory that the launcher will happily execute from.

Clickjacking supplies the user interaction. If the vulnerable flow can be framed or embedded, the attacker overlays buttons so the victim performs the steps without understanding them. The mark of the web and similar reputation checks are the operating system's defence against exactly this, which is why the report spends time on ways around them.

The report's proposed fixes are to disable feed preview on embedded feed files, prevent the file picker from downloading remote files, and whitelist or blacklist directories for custom feed reader apps.

How to test for it

Look for features that launch external programs: feed readers, protocol handlers, mail clients, media players, editors. Then check whether the selection dialog accepts something other than a local path.

  1. Trigger the custom-application flow and inspect the picker. Try entering a URL you control instead of browsing to a file.
  2. If the picker accepts it, observe where the file is written. A temporary download directory is the interesting case.
  3. Complete the flow and see whether the downloaded file is executed.
  4. Repeat with the feature embedded in a frame to see whether the interaction can be clickjacked.

A positive result is a file you control being fetched and then run. Common false positives are a picker that accepts the URL but refuses to execute the result, a download that lands somewhere the launcher will not run from, or a warning dialog that cannot be dismissed without genuine user consent. Confirm execution rather than assuming it from the download alone.

How it is fixed

The report proposes rejecting remote URLs in the picker, whitelisting trusted directories or blacklisting the temporary web download folder, and disabling the custom-application part of previews for embedded content.

Hunting notes

These bugs tend to hide in older or less-maintained features that bridge the browser and the operating system: feed preview, protocol handlers, download helpers, and anything that remembers a user-chosen application. Recon signals include features that are deprecated but still shipped, preview pages that render attacker-supplied content, and any flow where a file picker or open dialog appears inside a page context.

To get a report accepted, show the full chain end to end, including the execution step, and be honest about the interaction required. Where a platform warning stands in the way, describe the bypass as a hypothesis unless you have demonstrated it. Proposing concrete mitigations, as this report does, helps the triager see the fix.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

Firefox has a built-in feature called feed preview. A feed is a document that websites publish, listing updates such as new articles, so that a reader program can collect them. Firefox recognises files of a particular type, application/vnd.mozilla.maybe.feed, and shows them in its own preview page. That page lets you subscribe to the feed using a program of your choice, for example a desktop feed reader installed on your computer.

The researcher showed that this "choose your own program" step could be abused. When you pick a custom application, a file picker opens, the same kind of dialog you see when you upload or open a file. That dialog accepted a web address (an HTTP URL) instead of a file on your disk. When the user clicked open, Firefox downloaded the file at that address into a temporary folder on the computer. When the user then clicked subscribe, Firefox ran the downloaded file.

In other words, a page could make the browser fetch a program from the internet and then launch it, as long as the user went through a few clicks. The researcher tested this on the latest Nightly build at the time, v59.0a1 (2017-11-30) (64-bit), on Windows, and attached a proof of concept file named feedrce.html. A proof of concept is a small demonstration that shows a bug is real without doing harm.

The proof of concept also embedded the feed preview inside another page. Embedding means showing one page inside a frame within another page, like a picture inside a picture frame. This made a clickjacking attack possible. Clickjacking is a trick where the attacker places invisible or disguised buttons over a page so that the victim clicks something they did not intend to click. The victim thinks they are clicking one thing, but the click lands on the attacker's control.

The steps in the proof of concept were:

  1. Click the first button from the top. This copies a malicious executable; in this case it was the researcher's own hosted batch file that simply opens the calculator. A batch file is a small script that Windows can run, and the calculator is a harmless program used here just to prove that code ran.
  2. Click the second button. A drop-down menu appears; choose the Choose Application.. option.
  3. A file picker appears. Paste the URL copied in step 1 and hit open.
  4. Click the last button.

Each step matters because together they form a chain. Step 1 puts an attacker-controlled address on the clipboard, so the victim does not have to type anything. Step 2 opens the feature that lets you choose a program. Step 3 is the core flaw: the picker treats a web address as if it were a program on disk, so Firefox downloads the file into a temporary folder. Step 4 triggers the subscribe action, which runs the downloaded file.

There is one obstacle. Files downloaded from the internet on Windows get a marker called the mark of the web, and Windows shows an "unknown publisher" warning before running them. The researcher noted that this warning did appear. They suggested it could be bypassed by downloading a .jar file instead, and added that while the warning appears for most executables, getting around it with a stolen certificate or a Windows bug is not far fetched. A certificate is a digital identity that software publishers use to sign their programs; a stolen one would make malicious software look trustworthy.

The report proposed three possible fixes:

  1. Disable feed preview on embedded feed files, or at least the part that allows custom apps.
  2. Prevent the file picker from downloading remote files, though this may be a Windows-specific problem.
  3. Add a whitelist of directories allowed to contain custom feed reader apps, or blacklist the temporary web download folder. A whitelist is a list of things that are allowed; a blacklist is a list of things that are forbidden.

The researcher noted that this requires high user interaction. They also framed it as pointing to a bigger problem: the feed previewer could be used for download-and-execute attacks, which could turn a uXSS into a full RCE. uXSS is the abbreviation the report uses; it does not define it. RCE means remote code execution, running the attacker's program on the victim's machine. The researcher presented this last point as an assumption, not something they had demonstrated: if someone could run JavaScript inside feed preview pages, they could fake a custom app subscription and get the same download-and-execute chain.

In general, how this kind of bug works

This is a download-and-execute chain reached through a trusted part of the browser's interface. The pattern appears when a browser feature that is meant to launch a helper program installed on your computer accepts a location the attacker controls, and then runs whatever it finds there. Two things make it work: the picker treats a web address as a valid source for a program, and the downloaded file lands in a folder the launcher will happily run from.

Clickjacking supplies the user interaction. If the vulnerable flow can be embedded in a frame, the attacker overlays buttons so the victim performs the steps without understanding them. The mark of the web and similar reputation checks are the operating system's defence against exactly this, which is why the report spends time on ways around them.

The report's proposed fixes are to disable feed preview on embedded feed files, prevent the file picker from downloading remote files, and whitelist or blacklist directories for custom feed reader apps.

In general, how to test for it

Look for features that launch external programs: feed readers, protocol handlers, mail clients, media players, editors. Then check whether the selection dialog accepts something other than a local path.

  1. Trigger the custom-application flow and inspect the picker. Try entering a URL you control instead of browsing to a file.
  2. If the picker accepts it, observe where the file is written. A temporary download directory is the interesting case.
  3. Complete the flow and see whether the downloaded file is executed.
  4. Repeat with the feature embedded in a frame to see whether the interaction can be clickjacked.

A positive result is a file you control being fetched and then run. Common false positives are a picker that accepts the URL but refuses to execute the result, a download that lands somewhere the launcher will not run from, or a warning dialog that cannot be dismissed without genuine user consent. Confirm execution rather than assuming it from the download alone.

In general, how it is fixed

The report proposes rejecting remote URLs in the picker, whitelisting trusted directories or blacklisting the temporary web download folder, and disabling the custom-application part of previews for embedded content.

In general, where to hunt

These bugs tend to hide in older or less-maintained features that bridge the browser and the operating system: feed preview, protocol handlers, download helpers, and anything that remembers a user-chosen application. Signals worth watching include features that are deprecated but still shipped, preview pages that render attacker-supplied content, and any flow where a file picker or open dialog appears inside a page context.

To get a report accepted, show the full chain end to end, including the execution step, and be honest about the interaction required. Where a platform warning stands in the way, describe the bypass as a hypothesis unless you have demonstrated it. Proposing concrete mitigations, as this report does, helps the triager see the fix.

Glossary

  • Feed: a file a website publishes so that reader programs can collect its updates.
  • Feed preview: Firefox's built-in page that displays a feed and offers to subscribe to it.
  • File picker: the dialog that lets you browse to and select a file on your computer.
  • HTTP URL: a web address, such as the location of a file on a server.
  • Executable: a file that the computer can run as a program.
  • Batch file: a small script file that Windows can execute.
  • Proof of concept (PoC): a small demonstration that proves a bug is real.
  • Clickjacking: tricking a user into clicking something they did not intend, often by overlaying disguised buttons.
  • Embedding / framing: showing one page inside another page within a frame.
  • Mark of the web: a marker Windows attaches to files downloaded from the internet.
  • Unknown publisher warning: the Windows dialog that warns you before running software it cannot verify.
  • Certificate: a digital identity used to sign software so its publisher can be verified.
  • Whitelist: a list of things that are explicitly allowed.
  • Blacklist: a list of things that are explicitly forbidden.
  • uXSS (universal cross-site scripting): a bug that lets an attacker run their own JavaScript inside a trusted browser page.
  • RCE (remote code execution): running an attacker's program on the victim's machine.
  • Download-and-execute: an attack where a file is fetched from the internet and then run.
  • Protocol handler: a browser feature that hands a link to an external program, such as a mail client.
  • Triager: the person who reviews a bug report and decides whether it is valid.

More by Abdulrahman Alqabandi

View all

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

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.