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.

260 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sVulnerabilitiesVulnerabilities that lead to information disclosure include:●●Weak exception h<strong>and</strong>lingLetting raw exception details propagate to the clientAttacksThere are many attacks that can result in information disclosure. These include:●●Buffer overflows.Sending deliberately malformed input.CountermeasuresTo prevent information disclosure:●●●Use structured exception h<strong>and</strong>ling.Return generic error pages to the client.Use default redirect pages that contain generic <strong>and</strong> harmless error messages.Design ConsiderationsBefore you develop <strong>Web</strong> pages <strong>and</strong> controls, there are a number of important issuesthat you should consider at design time. The following are the key considerations:●●●●●●●●Use server-side input validation.Partition your <strong>Web</strong> site.Consider the identity that is used for resource access.Protect credentials <strong>and</strong> authentication tickets.Fail securely.Consider authorization granularity.Place <strong>Web</strong> controls <strong>and</strong> user controls in separate assemblies.Place resource access code in a separate assembly.Use Server-Side Input ValidationAt design time, identify all the various sources of user input that your <strong>Web</strong> pages <strong>and</strong>controls process. This includes form fields, query strings, <strong>and</strong> cookies received fromthe <strong>Web</strong> user, as well as data from back-end data sources. The <strong>Web</strong> user clearly livesoutside your application’s trust boundary, so all of the input from that source must bevalidated at the server. Unless you can absolutely trust the data retrieved from backenddata sources, that data should also be validated <strong>and</strong> sanitized before it is sent tothe client. Make sure your solution does not rely on client-side validation because thisis easily bypassed.

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

Saved successfully!

Ooh no, something went wrong!