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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 10: Building Secure ASP.NET Pages <strong>and</strong> Controls 281Encrypt the CookieEncrypt the cookie contents even if you are using SSL. This prevents an attacker fromviewing or modifying the cookie if he or she manages to steal it through a XSSexploit. In this event, the attacker can still use the cookie to gain access to yourapplication. The best way to mitigate this risk is to implement the appropriatecountermeasures to prevent XSS attacks (described under “Cross-Site Scripting”earlier in this chapter), <strong>and</strong> limit the cookie lifetime as described in the nextrecommendation.To provide privacy <strong>and</strong> integrity for the cookie, set the protection attribute on the element as follows:

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

Saved successfully!

Ooh no, something went wrong!