Apache httpOnly Cookie 泄露漏洞修复方法

by thanks

 insightlabs里看到<Apache httpOnly Cookie 泄露分析>

http://insight-labs.org/?p=267

漏洞原理分析就不多说了,文章里都有

但并未提到漏洞修补方法,正好在这做个补充。

漏洞原理和过程:

1.       受害者中了跨站,浏览器发出携带超大cookies的包

2.       服务器返回400错误,并会在response包里返回cookies内容

其中也包括httponly的。如图,xss0被设置为httpony依然显示出来



解决方案:

于是可以通过错误处理来屏蔽。

Apache官方提供4种错误处理方式(http://httpd.apache.org/docs/2.0/mod/core.html#errordocument),如下

In the event of a problem or error, Apachecan be configured to do one of four things,

1.    output asimple hardcoded error message输出一个简单生硬的错误代码信息

2.    output acustomized message输出一段信息

3.    redirect to alocal URL-path to handle the problem/error转向一个本地的自定义页面 

4.   redirect to an external URL to handle theproblem/error转向一个外部URL

经测试,对于400错误只有方法2有效,返回包不会再包含cookie内容

Apache配置:

ErrorDocument400 " security test"

当然,升级apache到最新也可:)。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值