Closed Bug 195804 Opened 23 years ago Closed 20 years ago

RFE: JavaScript POST form submit on page load should generate a warning

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED EXPIRED

People

(Reporter: swaters, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030130 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030130 According to: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3 --- 10.3 Redirection 3xx This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. The action required MAY be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD --- Typically, HTMLers work around this "problem" by doing something like: <body onload="JavaScript:document.form1.submit();"> <form name="form1" action="https://third-party.com"> <input type="hidden" name="secret1" value="secret1!"/> <input type="hidden" name="secret2" value="secret2!"/> </form> I contend that this should generate a warning since this violates the _spirit_ of rfc2616 by allowing redirection of POST data to 3rd parties in the following manner: 1. Browser POSTs to intended target. 2. Target generates page with JavaScript onload form submit HTML. 3. Browser submits form with original POSTed data to unknown third party. Comments? I love mozilla. Keep up the good work, guys! -s Reproducible: Always Steps to Reproduce:
of course, that HTML should be: - <form name="form1" action="https://third-party.com"> + <form name="form1" action="https://third-party.com" method="POST">
Over to Form Submission, and cc:ing some security people in case they have opinions about this.
Assignee: jst → form-submission
Component: DOM Level 0 → Form Submission
OS: Linux → All
Hardware: PC → All
We already have a warning for form submit of insecure forms.... The idea of not redirecting POST is to not redirect data the _user_ typed in to a different server. In this case, that's not an issue, is it?
I think what could happen is that the original page gets redirected to server generated page that contains information the user typed in for the original URL.
Exactly. The RFC is worried about POST data being redirected to a third party without the user's knowledge. I'm just expanding the scope of that concern from the HTTP protocol level to include a common JavaScript hack in dynamic HTML pages which effectively does the same thing.
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → EXPIRED
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.