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.

120 Part II:Designing Secure <strong>Web</strong> <strong>Application</strong>sHow Do You Secure Encryption Keys?The encrypted data is only as secure as the key. To decipher encrypted data, anattacker must be able to retrieve the key <strong>and</strong> the cipher text. Therefore, examine yourdesign to ensure that the encryption keys <strong>and</strong> the encrypted data are secured.Consider the following review questions:● How do you secure the encryption key?If you use DPAPI, the platform manages the key for you. Otherwise, theapplication is responsible for key management. Examine how your applicationsecures its encryption keys. A good approach is to use DPAPI to encrypt theencryption keys that are required by other forms of encryption. Then securelystore the encrypted key, for example, by placing it in the registry beneath a keyconfigured with a restricted ACL.● How often are keys recycled?Do not overuse keys. The longer the same key is used, the more likely it is to bediscovered. Does your design consider how <strong>and</strong> how often you are going torecycle keys <strong>and</strong> how they are going to be distributed <strong>and</strong> installed on yourservers?Parameter ManipulationExamine how your application uses parameters. These parameters include formfields, query strings, cookies, HTTP headers, <strong>and</strong> view state that are passed betweenclient <strong>and</strong> server. If you pass sensitive data, such as session identifiers, usingparameters such as query strings, a malicious client can easily bypass your serverside checks with simple parameter manipulation. Table 5.8 shows the most commonparameter manipulation vulnerabilities.Table 5.8 Common Parameter Manipulation VulnerabilitiesVulnerabilityFailing to validate all inputparametersImplicationsYour application is susceptible to denial of service attacks <strong>and</strong>code injection attacks, including SQL injection <strong>and</strong> XSS.Sensitive data in unencryptedcookiesSensitive data in query strings<strong>and</strong> form fieldsTrusting HTTP headerinformationUnprotected view stateCookie data can be changed at the client or it can be captured<strong>and</strong> changed as it is passed over the network.This is easily changed on the client.This is easily changed on the client.This is easily changed on the client.

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

Saved successfully!

Ooh no, something went wrong!