webRequest w/requestBody causes problems with big text in multipart forms

Bug reports and enhancement requests
Post Reply
opennota
Posts: 1
Joined: Sun Nov 10, 2019 3:09 am

webRequest w/requestBody causes problems with big text in multipart forms

Post by opennota »

When I send 1200000+ bytes of text in a multipart form, the request never ends if NoScript is enabled. Firefox 70.0.1.

A simple web server in Go which demonstrates the problem (run it, open localhost:1234, paste some text and press the button):

Code: Select all

package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
)

func handler(w http.ResponseWriter, r *http.Request) {
	if r.Method == "GET" {
		fmt.Fprintln(w, `<!DOCTYPE html><html><head><meta charset=utf-8></head><body>
        <form method="POST" enctype="multipart/form-data" action="/">
        <textarea name="text"></textarea>
        <button type="submit">Submit</button>
        </form></body></html>`)
	} else {
		println("start of io.Copy")
		io.Copy(os.Stdout, r.Body)
		println("end of io.Copy")
		os.Exit(0)
	}
}

func main() {
	http.HandleFunc("/", handler)
	log.Fatal(http.ListenAndServe(":1234", nil))
}
And the code to generate 1200000 bytes of text:

Code: Select all

package main

import (
	"io/ioutil"
	"strings"
)

func main() {
	s := strings.Repeat("a ", 600000)
	ioutil.WriteFile("120000_bytes.txt", []byte(s), 0600)
}
Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript 11.0.8 causes problems with sending big multipart forms

Post by Giorgio Maone »

Thanks for your report.
It's not NoScript-specific, but a Firefox bug for which I've just submitted this ticket.
Last edited by barbaz on Mon Nov 11, 2019 4:02 pm, edited 1 time in total.
Reason: fix typo in bbcode of bugzilla link
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0
Post Reply