Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: ALERT Re: Is this a bug in HTML::Form::Input or am I doing something wrong?

by Speedy (Monk)
on Mar 01, 2002 at 18:54 UTC ( [id://148647]=note: print w/replies, xml ) Need Help??


in reply to ALERT Re: Is this a bug in HTML::Form::Input or am I doing something wrong?
in thread Is this a bug in HTML::Form::Input or am I doing something wrong?

Maybe we are talking at cross-purposes. The scenario I am thinking of is that no script, whether client-browser-based (like JavaScript) or generated in a browser by a script should be able to force a value into the INPUT TYPE=FILE form element AND on its own issue a SUBMIT. I understood that to be the basis of the problem described above: test an existing browser form by using a script to execute it, including the definition of a value from the script for the VALUE element of the INPUT TYPE=FILE form element.

The W3C HTML 4 specifications are quite explicit about this:
"A user agent should not send any file that the user has not explicitly asked to be sent. Thus, HTML user agents are expected to confirm any default file names that might be suggested by the value attribute of the INPUT element. Hidden controls must not specify files."
http://www.w3.org/TR/html401/appendix/notes.html#forms-security

I also found an email exchange about the issue on the W3C site.

> And about the security considerations, lets just hope that
> Java/J/ECMAscript and the DOMs aren't allowing write access to
> the INPUT TYPE=FILE VALUE attributes and submitting forms by
> themselves these days.

The response:
Luckily Microsoft and Netscape have indeed noticed this, and both have made file input VALUE attributes read-only (you can write to them but it fails silently). This is contrary to the documentation at msdn.microsoft.com though. (Which says value and outerHTML are both read/write.)
http://lists.w3.org/Archives/Public/www-html/2000Apr/0018.html

Are you suggesting that a script be able to input the VALUE of the INPUT TYPE=FILE form element without user intervention in a browser file and force a SUBMIT, or do you have some ohter scenario in mind?

Live in the present
  • Comment on Re: ALERT Re: Is this a bug in HTML::Form::Input or am I doing something wrong?

Replies are listed 'Best First'.
Re: Re: ALERT Re: Is this a bug in HTML::Form::Input or am I doing something wrong?
by gregorovius (Friar) on Mar 01, 2002 at 19:46 UTC
    You are right when you are talking about a browser automatically sending a file without user intervention. Browsers shouldn't do that.

    But, the problem posed here is about having a LWP::UserAgent script submit a form, not about a browser doing it without a user's consent. Submitting a file with a request is perfectly doable with LWP::UserAgent.

    A quick search at google for "upload file script LWP" pointed me to this URL with an example script for doing this.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://148647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-05-22 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found