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.

Chapter 5: Architecture <strong>and</strong> Design Review for <strong>Security</strong> 121Examine the following questions to help ensure that your design is not susceptible toparameter manipulation attacks:●●●Do you validate all input parameters?Do you pass sensitive data in parameters?Do you use HTTP header data for security?Do You Validate All Input Parameters?Check that your application validates all input parameters, including regular <strong>and</strong>hidden form fields, query strings, <strong>and</strong> cookies.Do You Pass Sensitive Data in Parameters?If your application passes sensitive data in parameters such as query strings or formfields, examine why your application favors this approach over the much moresecure approach of passing a session identifier (for example, in an encrypted cookie).Use this information to associate the session with the state of a user that ismaintained in the state store on the server. Consider the following review points:● Do you encrypt cookies with sensitive data?If your application uses a cookie that contains sensitive data, such as a user nameor a role list, make sure it is encrypted.● Do you pass sensitive data in query strings or Form fields?This is not recommended because there is no easy way to prevent themanipulation of data in query strings or form fields. Instead, consider usingencrypted session identifiers <strong>and</strong> store the sensitive data in the session state storeon the server.● Do you protect view state?If your <strong>Web</strong> pages or controls use view state to maintain state across HTTPrequests, check that the view state is encrypted <strong>and</strong> checked for integrity withmessage authentication codes (MACs). You can configure this at the machine levelor on a page-by-page basis.Do You Use HTTP Header Data for <strong>Security</strong>?Make sure that your <strong>Web</strong> application does not make security decisions based oninformation in HTTP headers because an attacker can easily manipulate the header.Do not rely on the value of the HTTP referer field to check that the request originatedfrom a page that is generated by your <strong>Web</strong> application — this creates vulnerabilities.Doing this is inherently insecure because the referer field can easily be changed bythe client.

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

Saved successfully!

Ooh no, something went wrong!