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.

696 <strong>Improving</strong> <strong>Web</strong> <strong>Application</strong> <strong>Security</strong>: <strong>Threats</strong> <strong>and</strong> Countermeasures<strong>Application</strong> Categories ConsiderationsInput ValidationCheck DescriptionUser input is validated for type, length, format, <strong>and</strong> range. Input is checked for known valid<strong>and</strong> safe data <strong>and</strong> then for malicious, dangerous data.String form field input is validated using regular expressions (for example, by theRegularExpressionValidator control.)Regular HTML controls, query strings, cookies, <strong>and</strong> other forms of input are validated usingthe Regex class <strong>and</strong>/or your custom validation code.The RequiredFieldValidator control is used where data must be entered.Range checks in server controls are checked by RangeValidator controls.Free form input is sanitized to clean malicious data.Input file names are well formed <strong>and</strong> are verifiably valid within the application context.Output that includes input is encoded with HtmlEncode <strong>and</strong> UrlEncode.MapPath restricts cross-application mapping where appropriate.Character encoding is set by the server (ISO-8859-1 is recommended).The ASP.NET version 1.1 validateRequest option is enabled.URLScan is installed on the <strong>Web</strong> server.The HttpOnly cookie option is used for defense in depth to help prevent cross-site scripting.(This applies to Internet Explorer 6.1 or later.)SQL parameters are used in data access code to validate length <strong>and</strong> type of data <strong>and</strong> tohelp prevent SQL injection.AuthenticationCheck DescriptionSite is partitioned to restricted areas <strong>and</strong> public areas.Absolute URLs are used for navigation where the site is partitioned with secure <strong>and</strong> nonsecurefolders.Secure Sockets Layer (SSL) is used to protect credentials <strong>and</strong> authentication cookies.The slidingExpiration attribute is set to “false” <strong>and</strong> limited authentication cookie time-outsare used where the cookie is not protected by using SSL.

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

Saved successfully!

Ooh no, something went wrong!