Easy answer: "No, you are not invulnerable, no one!"
This is a good start, but there are a few more things you could do. The main thing that you did not mention is the verification of untrusted data against the whitelist, and this is important because it covers several exploits, such as SQLi and XSS. Take a look at OWASP Top 10 for .NET Developers Part 1: Injection and, in particular, the section "All input should be validated against a whitelist of valid value ranges."
Next, you must apply the principle of least privilege to accounts connecting to your SQL Server. See the header under this name in the previous link.
Given that you are working with ASP.NET, make sure that query validation remains enabled, and if you absolutely must disable it, just do it at the page level. More on this in Verification Request, DotNetNuke, and Utopia Design .
The main thing for your output encoding is to make sure that you encode the correct context. HTML Encoding! = JavaScript Encoding! = CSS Encoding. More on this in OWASP Top 10 for .NET Developers Part 2: Scripts for Different Sites (XSS) .
For cookies, only make them HTTP and, if possible, allow them to be served securely (if you are only happy with the launch of HTTPS). Try putting your web.config through the web.config security analyzer , which will help you in the right direction.
Another CSRF defense - albeit with a usability effect - is CAPTCHA. Obviously, you want to use it with restraint, but if you have really important functions that you want to protect, it sets up pretty quickly. Learn more in OWASP Top 10 for .NET Developers Part 5: Cross-Site Request Forgery (CSRF) .
In addition, it seems that you know many important principles. It will not make you invulnerable, but it is a good start.
Troy hunt
source share