Skip to content
File upload Disclosed report Intermediate CVE-2022-45415

Create arbitrary binary(.hta,.exe,.bat,.vb)/file when web page is downloaded/saved in firefox browser

Firefox's 'Save Page As' feature used the page's title tag to name the saved file without sanitising it, so a malicious page could cause a file with an executable extension to be saved. Opening that file could lead to code execution.

Jayateertha Guruprasad Follow

Originally disclosed on Mozilla

  • Fixed in 16 days
  • Paid in 22 days
  • Disclosed after 16 days

Created attachment 9297079 index.html

Products affected:

Latest Firefox for Windows as on 04/10/22

POC:

See this Video POC - https://youtu.be/5PBJ1MlikFk

  1. Host malicious webpage (index.html) [See attached file].
  2. Click save as to download the website to view offline or press (ctrl + s).
  3. Save the file & open downloaded file

Impact

  1. Create arbitrary files instead of html file, which might result in code execution when opened.

Fix

  1. Sanitize filename properly & append .html to filename created from title tag by default as done by major browsers such as Google Chrome.

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

Root cause

Likely the browser did not sanitise the filename derived from the page title and did not force a safe extension such as .html.

Impact

A user who saves and then opens the downloaded file could run attacker-controlled code, though this requires the user to open the file.

What the attacker needed

Victim uses Firefox on Windows; victim saves the page; victim opens the saved file

How it was found

  1. Host a malicious web page.
  2. Use the browser's save-as feature to download the page.
  3. Save the file and open the downloaded file.

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 you save a web page, the browser suggests a filename, often taken from the page's title. This report shows that Firefox did not clean up that suggested name, so a bad page could make the saved file end in something like .exe or .hta. If the user then opens that file, it could run code on their computer.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by Jayateertha Guruprasad

View all

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

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.