@Html.Raw() and ensure that there is no possible way a malicious user could inject anything into it.@… in JavaScript code. This should be encoded with the @Encoder.JavaScriptEncode() method.<form> elements contain a @Html.AntiForgeryToken().[ValidateAntiForgeryToken] (a standard filter attribute) and [IsPostedFromThisSite] (a custom filter attribute).Web.config file contains <httpCookies domain=“” httpOnlyCookies=“true” requireSSL=“false” /> (prevents JavaScript from accessing cookies).[Bind(Include=“Foo, Bar”)] attribute.return Redirect(url); method calls are preceded by a IsLocalUrl(url) check and failures are logged.return Redirect(url); method calls are preceded by a IsLocalUrl(url) check and failures are logged.return Redirect(url); method calls exist (they should be replaced by return RedirectToLocal(url);).machine.config of the web server (found at %windir%\Microsoft\.NET\Framework\<frameworkversion>\Config), switch on 'retail':<system.web> <deployment retail="true" /> </system.web>
 This will set customErrors mode to On and disable trace output and debug. It can not be overridden by the Web.config.   
Web.config set customErrors mode to On:<system.web> <customErrors defaultRedirect="GenericError.html" mode="On"> <error statusCode="500" redirect="InternalError.html"/> </customErrors> <system.web>
public - all others must be protected or private.