web.config中的HttpCookie.HttpOnly属性
Abstract:
The program does not set the HttpCookie.HttpOnly property to true.
Explanation:
The default value for the httpOnlyCookies attribute is false, meaning that the cookie is accessible through a client-side script.
This is an unnecessary cross-site scripting threat, resulting in stolen cookies. Stolen cookies can contain sensitive information
identifying the user to the site, such as the ASP.NET session ID or forms authentication ticket, and can be replayed by the
attacker in order to masquerade as the user or obtain sensitive information.
Example 1: Vulnerable configuration:
<configuration>
<system.web>
<httpCookies httpOnlyCookies="false">
Recommendations:
Microsoft Internet Explorer version 6 Service Pack 1 and later supports a cookie property, HttpOnly, that can help mitigate crosssite
scripting threats that result in stolen cookies. Stolen cookies can contain sensitive information identifying the user to the site,
such as the ASP.NET session ID or forms authentication ticket, and can be replayed by the attacker in order to masquerade as the
user or obtain sensitive information. When an HttpOnly cookie is received by a compliant browser, it is inaccessible to clientside
script.
Example 2: Here see the secure configuration. Any cookie marked with this property will be accessible only from server-side
code, and not to any client-side scripting code like JavaScript or VBScript. This shielding of cookies from the client helps to
protect Web-based applications from cross-site scripting attacks. A hacker initiates a cross-site scripting (also called CSS or
XSS) attack by attempting to insert his own script code into the Web page to get around any application security in place. Any
page that accepts input from a user and echoes that input back is potentially vulnerable.
<configuration>
<system.web>
<httpCookies httpOnlyCookies="true">
Tips:
1. It is possible to enable HttpOnly programmatically on any individual cookie by setting the HttpOnly property of the
HttpCookie object to true. However, it is easier and more reliable to configure the application to automatically enable HttpOnly
for all cookies. To do this, set the httpOnlyCookies attribute of the httpCookies element to true.
2. Setting the HttpOnly property to true does not prevent an attacker with access to the network channel from accessing the
cookie directly. Consider using Secure Sockets Layer (SSL) to help protect against this. Workstation security is also important,
as a malicious user could use an open browser window or a computer containing persistent cookies to obtain access to a Web site
with a legitimate user's identity.
web.config中的HttpCookie.HttpOnly属性的更多相关文章
- WCF项目问题2-无法激活服务,因为它需要 ASP.NET 兼容性。没有未此应用程序启用 ASP.NET 兼容性。请在 web.config 中启用 ASP.NET 兼容性,或将 AspNetCompatibilityRequirementsAttribute.AspNetCompatibilityRequirementsMode 属性设置为 Required 以外的值。
无法激活服务,因为它需要 ASP.NET 兼容性.没有未此应用程序启用 ASP.NET 兼容性.请在 web.config 中启用 ASP.NET 兼容性,或将 AspNetCompatibility ...
- web.config中配置页面出错后跳转指定错误页面
每当用户访问错误页面时,会出现不友好的404错误,所以为了防止这种不友好,我们在web.config中的<system.web>节点下配置 <customErrors>,在出现 ...
- ASP.Net Web.config 中引用外部config文件
1. 前提准备: Web.config file: <?xml version="1.0" encoding="utf-8"?><config ...
- web.config中sessionState节点的配置方案
web.config中sessionState节点的配置方案 web.config关于sessionState节点的配置方案,sessionState有五种模式:Custom,off,inProc,S ...
- web.config中<customErrors>节点
错误提示: “/”应用程序中的服务器错误.------------------------------------------------------------------------------- ...
- web.config中configSections section节 -Z
由于最近一个项目的数据库变动比较频繁, 为了减少数据层的负担, 打算采用.net的MVC框架, 使用LINQ对付数据层. 这个框架的web.config文件里出现了configSectio ...
- ASP.NET web.config中数据库连接字符串connectionStrings节的配置方法
ASP.NET web.config中数据库连接字符串connectionStrings节的配置方法 第一种情况,本地开发时,使用本地数据库,如下面的代码 <connectionStrings& ...
- web.config中的InProc模式 与 StateServer模式[转]
开发asp.net应用时,修改web.config中的SessionState节点. <sessionState mode="StateServer" stateConnec ...
- asp.net mvc 3 配置全局错误处理 Web.config中设置CustomError
摘自: http://www.myexception.cn/web/1130191.html asp.net mvc 配置全局异常处理 Web.config中设置CustomError Web.con ...
随机推荐
- IIS7.5下发布应用程序备忘
近期工作需要把应用程序发布升级到IIS7.5中,IIS7部署方式跟IIS6差别还是挺大的. 部署常规方式:新建虚拟目录>转成应用程序. 在本机用http://localhost/别名访问一切正常 ...
- [转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only
Okay for centos 6.4 also On apu.0xdata.loc, after this install was done $ which python /usr/local/bi ...
- maven 记录
1. Can't find parent: 工程中的pom.xml中定义的”project -> version”或者”parent project -> version”设置的不对导致 ...
- Python 2.7.x 和 3.x 版本的重要区别
许多Python初学者都会问:我应该学习哪个版本的Python.对于这个问题,我的回答通常是“先选择一个最适合你的Python教程,教程中使用哪个版本的Python,你就用那个版本.等学得差不多了,再 ...
- OAF_开发系列09_实现OAF预提取LOV设定(案例)
20150712 Created By BaoXinjian
- Interview
下面的题是供大家查漏补缺用的,真正的把这些题搞懂了,才能"以不变应万变". 回答问题的时候能联系做过项目的例子是最好的,有的问题后面我已经补充联系到项目中的对应的案例了. 1.简述 ...
- Nexus3.0.0+Maven的使用(三)
这章主要讲怎么和Maven做集成,集成的方式主要分以下种情况:代理中央仓库.Snapshot包的管理.Release包的管理.第三方Jar上传到Nexus上 1 代理中央仓库 只要在PMO文件中配置 ...
- exp导出做成批处理注意事项
不能叫exp.bat,会一直显示导出这句话. 出现EXP-00106: 数据库链接口令无效:是因为http://blog.csdn.net/hzfu007/article/details/189823 ...
- SQL加权限
grant view definition on 存储过程名字 to 用户名
- C++ 队列的实现
/************************************************************************/ /* 实现一个通用同步队列 使用链表实现队列 (先 ...