Someone could save the page to their local hard disk, edit it as they wish, then load it and submit it.
HTTP Referrers are easily faked.
If you want security you must taint check all data submitted to the script.
Main Topics
Browse All TopicsI am trying to develop more secure web application code.
If I have an ASP.net page with textboxes that are read-only, is
there a way for a hacker to do something like:
view source
edit the source to make the textbox read-write
enter some malicious code
then send the request to the server.
If this is possible, how does the edited ASP/html, etc..
get loaded back into the browser such that it still has
a valid http connection.
(what is the relative path to get this to work without
simply calling the original ASP page? (which won't have
any of the changes)????
Any ideas..
ipaman
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
What is the problem really?
Even if people completely copy your page and serve it on another host, the submitted data is valid for your system. So what is the problem really?
You can always make it more difficult to use copied code by setting a session variable like session("validuser") = true when people loggin on your site. Then, check on all pages if this session var is available (and set to true). Then, if they host your code somewhere else and run it, they will not have a valid connection (session) and the page will not work!
Have fun!
I am a big advocate of taint checking all input from both external and internal sources....
But the original question has not been answered.
Is it possible to do the following, and why?:
view source
edit the source to make the textbox read-write
enter some malicious code
then send the request to the server.
View source:
always possible (you can do some stuff to make it more difficult to see, but everyone with normal computer experience will be able to view the source if they want to)
Edit the source:
possible on the client side after opening the view source in a text editor. BUT, they will NOT be able to upload (save) their changes to YOUR server (unless they really hack it ;-), but then they can do anything...) So whatever they do, each time they visit your page, they get YOUR code, not what they made of it.
Enter some malicious code
They can type whatever they want in the code and textboxes
Send request to the server
Submitting a form to your server will always work. Executing strange things on your server is almost impossible, unless it's not properly patched and they use some known (or unknown) bug in your webbrowser...
Generally, there is no reason to worry about people viewing your code. If you use server side scripting, the code is parsed on the server and the visitors will simply see some HTML without being able to view database passwords or so...
Just remember to make your include files with secure data in it parseable as well. I mainly use ASP to develop sites, so all include files have an extension .asp and not .inc .inc is just text and they can open it to view it in their browsers. If you put a database password inthere or so, it's easier to them, if you use .asp as an extension, you can put whatever you want in there, the page will be parsed by the webserver (IIS) and will return nothing to the client, because there's no HTML in it to be send to the client.
Have fun!
Quotes from my initial comment.
view source - Of course
edit the source to make the textbox read-write - Quote: "edit it as they wish"
enter some malicious code - Quote: "edit it as they wish" - they can put whatever they like. If the code is capable of causing problems depends on the level of taint checking.
then send the request to the server. - Quote: "then load it and submit it."
Business Accounts
Answer for Membership
by: rafa_Posted on 2003-06-29 at 14:09:56ID: 8823502
don't use textboxes.
or check the HTTP Referrer so it must come from the original page.