ASP.NET 2.0 Security Inspection Questions
From Guidance Share
- J.D. Meier, Alex Mackman, Blaine Wastell, Prashant Bansode, Jason Taylor, Rudolph Araujo
[edit]
Summary
Use security inspection questions for performing code inspections. Questions put you in the right state of mind when analyzing the code. The questions are organized by categories that are both actionable and tend to contain security issues. You can also chunk up your security inspection by the categories for iterative or incremental approaches.
[edit]
What's New in 2.0
- Does the code ensure that the connection strings configuration section is encrypted?
- Does the code ensure that membership providers use strong passwords?
- Does the code ensure that the roles cookie is encrypted and checked for integrity?
- Does the code ensure that the roles cookie has a limited life time?
- Does the code persist role manager cookies?
[edit]
Auditing and Logging
[edit]
Authentication
- Does the code enforce strong user management policies?
- Does the code restrict the number of failed login attempts?
[edit]
Authorization
- How does the code protect access to restricted pages?
- How does the code protect access to page classes?
- Does the code use Server.Transfer?
[edit]
Code Access Security
- Does the code use link demands or assert calls?
- Does the code use AllowPartiallyTrustedCallersAttribute?
- Does the code use potentially dangerous permissions?
- Does the code give dependencies too much trust?
[edit]
Cross-Site Scripting
- Does the code echo user input or URL parameters back to a Web page?
- Does the code persist user input or URL parameters to a data store that could later be displayed on a Web page?
[edit]
Cryptography
- Does the code use custom cryptographic algorithms?
- Does the code use the correct algorithm and an adequate key size?
- How does the code manage and store encryption keys?
- Does the code generate random numbers for cryptographic purposes?
[edit]
Data Access
- Does the application use SQL authentication?
- How does the application store database connection strings?
[edit]
Exception Management
- Does the code handle errors and exception conditions?
- Does the code use a global error handler?
- Does the code leak sensitive information in exceptions?
- Does the application expose sensitive information in user sessions?
- Does the application fail securely in the event of exceptions?
[edit]
Forms Authentication
- Does the code use membership?
- Does the code persist forms authentication cookies?
- Does the code reduce ticket life time?
- Does the code use protection="All"?
- Does the code restrict authentication cookies to HTTPS connections?
- Does the code use SHA1 for HMAC generation and AES for encryption?
- Does the code use distinct cookie names and paths?
- Does the code keep personalization cookies separate from authentication cookies?
- Does the code use absolute URLs for navigation?
- How does the code store passwords in databases?
- Does the code partition the Web site into restricted and public access areas?
[edit]
Impersonation
- Does the application use hard-coded impersonation credentials?
- Does the application clean up properly when it uses impersonation?
[edit]
Input and Data Validation
- Does the code validate data from all sources?
- Does the code use a centralized approach to input and data validation?
- Does the code rely on client-side validation?
- Does the code accept path or file-based input?
- Does the code validate URLs?
- Does the code use MapPath?
[edit]
Sensitive Data
- Does the code store secrets?
- Is sensitive data stored in predictable locations?
- Does the code store sensitive data in view state?
- Does the code pass sensitive data across Web pages?
[edit]
SQL Injection
- Is the application susceptible to SQL injection?
- Does the code use parameterized stored procedures?
- Does the code use parameters in SQL statements?
- Does the code attempt to filter input?
[edit]
Unsafe Code
- Is the code susceptible to buffer overruns?
- Is the code susceptible to integer overflows?
- Is the code susceptible to format string problems?
- Is the code susceptible to array out of bound errors?
[edit]
Potentially Dangerous Unmanaged APIs
[edit]