think "buffer overflow" and "site traversal." remember, a hacker isn't going to use a web browser. he/she'll post garbage at your server via a script or compiled program.
also, why purposely allow errors (which can give the user too much information), instead of preventing 'em?
it will stop the newbies though.
sorry i never noticed this thread being updated for a while. dang, and i even asked AB to make it a sticky!...
Hi Russell seems ur a pro that I was looking for...
actually i am a beginner to ASP and Server-Side scripting...I am doing a project for my college 'Attendance Record' and I am working with code(half done) on my laptop... But I dont know that when I will give it to my college and (if)they will copy it on the server then will it work the same way(completely error less) if accessed from a client????
if not give me link of basics required.....please Help....Thank You
A few things:
1. For EVERY field that you submit to the database, escape single quotes by doubling them up. This prevents 99% of the hacks and keeps the wannabe crackers out.
2. Validate data types. If you're expecting an integer value, test it to be sure b4 throwing it at the db, or doing any further processing.
3. Always specify maxlength in your HTML forms. For example, if your city field in your database is specified as varchar(30) then put a MAXLENGTH of 30 in the HTML form.
4. ALWAYS check HTTP_REFERER. If it doesn't come from your domain, reject it -- unless you're purposely exposing it outside.
Validate cookies, querystrings, form vars. In short, everything.
Before releasing any code, test it. Enter a single quote in every form field. Enter a single quote in any querystrings. If you get an error, it can be hacked.
Create a regular expression library and use it to validate everything.
Use paramaterized queries. This eliminates most of the garbage folks will try to throw at you.
Compared to when I made this post, today's servers and browsers are a lot more secure. But it only takes one mistake and you'll get hacked.
I'm sure that most of the FO will agree that validate Magento in the interface to form input fields are a nice feature. All it takes is for you to add some classes CSS to input fields are then run the model to validate delivery of products which, by default, messages colored red to indicate failure to validate possible etc. This is done to validate on the client side by Java script.
Bookmarks