博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决安全扫描Insecure HTTP Methods Enabled的问题
阅读量:4684 次
发布时间:2019-06-09

本文共 1354 字,大约阅读时间需要 4 分钟。

今天把Spring MVC的Java网站部署到CentOS上,并且设置了https/ssl 8443端口,然后用IBM Rational AppScan进行安全扫描,发现一个漏洞:Insecure HTTP Methods Enabled. 原因是Tomcat支持的http命令中包含DELETE、OPTIONS、PUT、HEAD和TRACE这五条命令。

 

 漏洞描述和建议:

Insecure HTTP Methods Enabled
Severity:  Medium
Type: Infrastructure test
WASC Threat Classification: Client-side Attacks: Content Spoofing
CVE Reference(s): N/A
Security Risk: It is possible to upload, modify or delete web pages, scripts and files on the web server
Fix Recommendation
If you do not need WebDAV enabled on your server, make sure that you either disable it, or disallow HTTP methods (verbs) that are unneeded.

 

解决办法

参考了帖子,但小题大做了,只需修改网站的web.xml添加下面的内容即可。

<
security-constraint
>
     
<
web-resource-collection
>
          
<
web-resource-name
>DisableUnsecureHttpActions
</
web-resource-name
>
          
<
url-pattern
>/*
</
url-pattern
>
          
<
http-method
>DELETE
</
http-method
>
          
<
http-method
>PUT
</
http-method
>
          
<
http-method
>HEAD
</
http-method
>
          
<
http-method
>TRACE
</
http-method
>
          
<
http-method
>OPTIONS
</
http-method
>
     
</
web-resource-collection
>
     
<
auth-constraint
>
        
<
role-name
>NotExistingRole
</
role-name
>
     
</
auth-constraint
>
     
<
user-data-constraint
>
        
<
transport-guarantee
>NONE
</
transport-guarantee
>
     
</
user-data-constraint
>
 
</
security-constraint
>

有关Security-constraint的理解,可以参考帖子。

作者的其它相关文章

转载于:https://www.cnblogs.com/Mainz/archive/2012/11/19/2777679.html

你可能感兴趣的文章
HTC Sensation G14开盒
查看>>
lock_sga引起的ksvcreate :process(m000) creation failed
查看>>
数据库插入数据乱码问题
查看>>
OVER(PARTITION BY)函数用法
查看>>
altium annotate 选项设置 complete existing packages
查看>>
【模式识别与机器学习】——SVM举例
查看>>
【转】IT名企面试:微软笔试题(1)
查看>>
IO流入门-第十章-DataInputStream_DataOutputStream
查看>>
DRF的分页
查看>>
html td 限制 高度 和 宽度
查看>>
mysql查询一个表的字段,添加或修改到另外一个表的数据
查看>>
CL.exe的 /D 选项, Preprocessor Macro预处理器宏定义
查看>>
[Pytorch]Pytorch中tensor常用语法
查看>>
ZOJ 1008 Gnome Tetravex
查看>>
Jenkin远程部署Tomcat8.5总结
查看>>
编写Linux中sh文件执行时出现莫名字符的问题
查看>>
简单数论(一)
查看>>
Populating Next Right Pointers in Each Node
查看>>
CXF和Axis的比较【转】
查看>>
设计一个函数,它接受不定数量的参数,这是参数都是函数。这些函数都接受一个回调函数作为参数,按照回调函数被调用的顺序返回函数名...
查看>>