
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Web Applications
|
351
• Example 16-2 in Web Security, Privacy, and Commerce (O’Reilly).
• Dos and Donts of Client Authentication on the Web (http://www.lcs.mit.edu/
publications/pubs/pdf/MIT-LCS-TR-818.pdf) describes how a team at MIT
cracked the authentication schemes of a number of commercial sites, including
the Wall Street Journal. Visit http://cookies.lcs.mit.edu/ for links to the Perl
source code of their Kooky Authentication Scheme.
Access Control and Authorization
Once authenticated, what is the visitor allowed to do? This is the authorization or
access control step. You can control access by a hostname or address, by the value of
an environment variable, or by a person’s ID and password. Broken access control is
the second highest vulnerability in the OWASP top 10 list.
Host-based access control
This grants or blocks access based on a hostname or IP address. Here is a sample
directive to prevent everyone at evil.com from viewing your site:
<Location />
order deny,allow
deny from .evil.com
allow from all
</Location>
The period before evil.com is necessary. If I said:
deny from evil.com
I would also be excluding anything that ends with evil.com, such as devil.com or
www.bollweevil.com.
You may also specify addresses:
Environment-variable access control
This is a very flexible solution