11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Contents xviiDeciding Which Approach to Take ............................................................................. 238Customizing Policy .............................................................................................. 238S<strong>and</strong>boxing ........................................................................................................ 238Medium Trust ......................................................................................................... 239Reduced Attack Surface ...................................................................................... 239<strong>Application</strong> Isolation............................................................................................ 239Medium Trust Restrictions ....................................................................................... 240OLE DB .............................................................................................................. 240Event Log ........................................................................................................... 244<strong>Web</strong> Services ..................................................................................................... 248Registry ............................................................................................................. 250Summary ............................................................................................................... 252Additional Resources .............................................................................................. 252Chapter 10Building Secure ASP.NET Pages <strong>and</strong> Controls 253In This Chapter ....................................................................................................... 253Overview ................................................................................................................ 253How to Use This Chapter ......................................................................................... 254<strong>Threats</strong> <strong>and</strong> Countermeasures ................................................................................. 254Code Injection .................................................................................................... 255Session Hijacking ............................................................................................... 256Identity Spoofing................................................................................................. 257Parameter Manipulation ...................................................................................... 258Network Eavesdropping ....................................................................................... 259Information Disclosure ........................................................................................ 259Design Considerations ............................................................................................ 260Use Server-Side Input Validation .......................................................................... 260Partition Your <strong>Web</strong> Site........................................................................................ 261Consider the Identity That Is Used for Resource Access......................................... 262Protect Credentials <strong>and</strong> Authentication Tickets...................................................... 262Fail Securely ....................................................................................................... 262Consider Authorization Granularity........................................................................ 263Place <strong>Web</strong> Controls <strong>and</strong> User Controls in Separate Assemblies .............................. 263Place Resource Access Code in a Separate Assembly ........................................... 263Input Validation....................................................................................................... 263Constrain, Then Sanitize...................................................................................... 264Regular Expressions............................................................................................ 264String Fields ....................................................................................................... 265Date Fields......................................................................................................... 267Numeric Fields.................................................................................................... 267Sanitizing Input................................................................................................... 269Validating HTML Controls..................................................................................... 269Validating Input Used for Data Access .................................................................. 270Validating Input Used For File I/O ......................................................................... 270Common Regular Expressions.............................................................................. 271

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!