Reputation: 304524
Watching SO come online has been quite an education for me. I'd like to make a checklist of various vunerabilities and exploits used against web sites, and what programming techniques can be used to defend against them.
Upvotes: 17
Views: 1982
Reputation: 2746
You can get good firefox addons to test multiple flaws and vulnerabilities like xss and sql injections from Security Compass. Too bad they doesn't work on firefox 3.0. I hope that those will be updated soon.
Upvotes: 1
Reputation: 24778
Some prevention techniques:
XSS
If you take any parameters/input from the user and ever plan on outputting it, whether in a log or a web page, sanitize it (strip/escape anything resembling HTML, quotes, javascript...) If you print the current URI of a page within itself, sanitize! Even printing PHP_SELF, for example, is unsafe. Sanitize! Reflective XSS comes mostly from unsanitized page parameters.
If you take any input from the user and save it or print it, warn them if anything dangerous/invalid is detected and have them re-input. an IDS is good for detection (such as PHPIDS.) Then sanitize before storage/printing. Then when you print something from storage/database, sanitize again! Input -> IDS/sanitize -> store -> sanitize -> output
use a code scanner during development to help spot potentially vulnerable code.
XSRF
SQL injection
Upvotes: 2
Reputation: 37113
G'day,
A good static analysis tool for security is FlawFinder written by David Wheeler. It does a good job looking for various security exploits,
However, it doesn't replace having a knowledgable someone read through your code. As David says on his web page, "A fool with a tool is still a fool!"
HTH.
cheers, Rob
Upvotes: 1
Reputation: 4323
I second the OWASP info as being a valuable resource. The following may be of interest as well, notably the attack patterns:
Upvotes: 6
Reputation: 6665
Easy to oversee and easy to fix: the sanitizing of data received from the client side. Checking for things such as ';' can help in preventing malicious code being injected into your application.
Upvotes: 1
Reputation: 2907
From the Open Web Application Security Project:
The top ten are:
Upvotes: 12
Reputation: 47007
Obviously test every field for vulnerabilities:
mysql_real_escape_string
)Search for infinite loops (the only indirect thing (if a lot of people found it accidentally) that could kill a server really).
Upvotes: 2