
brian.hayes
User
Jan 20, 2000, 6:44 PM
Post #1 of 6
(538 views)
|
|
Security Question??
|
Can't Post
|
|
I have been reading up on perl scripting and security. It has left me a little confused about some things. I understand that If you make a system call with a variable that derives from a CGI.pm "Form" variable that you need to take special care to ensure that the data entered by someone is what you really want it to be. BUT how far should this be taken. I have shtml enable on my web server and did some test. Test: Created a script <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #/path/to/perl use CGI; my $c = new CGI; print $c->header; my $in = $c->param('test'); print "<p>",$in,"</p>","\n"; </pre><HR></BLOCKQUOTE> Then a basic web form with a text box named "Test". <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> <HTML> <HEAD> <TITLE>Testing</TITLE> </HEAD> </BODY> <FORM method="post" action="pathtoscript"> <INPUT type="text" name="test" value=""> </FORM> </BODY> </HTML> </pre><HR></BLOCKQUOTE> When this is ran I get the data that was sent returned in the browser window..No mater what I type in the text box. Test 2: If I create a test.shtml. use a include stament. <!--include virtual=/path/to/script --> and put the form in the script via. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> print qq~ <FORM method="post" action="pathtoscript"> <INPUT type="text" name="test" value=""> </FORM> ~; </pre><HR></BLOCKQUOTE> The page displays ok. The data sent to the script displays ok, BUT if I put a include statment in the text box it will not display. I do not know where it is going. It is not being sent to anywhere other than a print statement. Can anyone give some insite on this.. Thankyou, Brian Hayes
|