Recently I had to patch an old asp site that had been victimized by an sql injection attack. Here is a list of security holes:
1. The database queries were not escaped/parameterized. That’s how the site was hacked.
2. GET and POST data were not validated or filtered. No XSS cleaning libraries back then I guess.
3. Html output from the database or user inputs wasn’t escaped leading to potential broken html or XSS attacks
4. The admin login form had fields for username and password, but only a hardcoded password within the script was checked.
5. None of the admin pages checked for an authenticated user. The login page was only window dressing!
6. Drum roll please. A public page took a file name directly from the url, opened that file, and output the contents within the page!! Want the database connection info? Sure: example.com/hack_me?file=web.config