I recently heard from a security audit that HTTP Options is insecure in general and the web-server should not allow it. Can someone explain the reasons why is it so ?
相关问题
- Angular RxJS mergeMap types
- Design RESTful service with multiple ids
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- Google Apps Script: testing doPost() with cURL
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Tomcat的User信息可以存储到数据库中吗?
- tomcat的server.xml支持从Oracle中获取数据吗?
- web项目,Resonse Header发生解析错误,请大牛帮忙看看究竟是哪里的问题?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- linux环境部署jpress,创建数据库时提提示连接失败
- Is a unicode user agent legal inside an HTTP heade
- Got ActiveRecord::AssociationTypeMismatch on model
One interesting point for REST servers, they are not unlikely to tell you which methods are allowed. For example, it may generate such a response:
The
OPTIONS
command returns similar information, it also tells you whether certain headers will be supported.And in the answer you get:
So we see the same information as shown in the 405 error above.
It supports all the CORS features so it could include an
Origin
and reply that it does (or not) accept said origin:will get a reply:
Some servers would implement the
PUT
andDELETE
commands to work on the server's file system directly and having theOPTIONS
available would smoothly tell you that these two methods were supported. I don't personally see why theOPTIONS
got its bad rep since attempting aPUT
would also tell you whether it was supported or not. So with or withoutOPTIONS
, if you have a stupid server implementation, a hacker can take over your server.Personally, I've never see a server that supported
PUT
andDELETE
to directly update your server's files! Now, if you do not have a REST or WebDav or a need for CORS, I would turn off theOPTIONS
feature because it is really not useful.OPTIONS is a diagnostic method, which returns a message useful mainly for debugging and the like. This message basically reports, surprisingly, which HTTP Methods are active on the webserver. In reality, this is rarely used nowadays for legitimate purposes, but it does grant a potential attacker a little bit of help: it can be considered a shortcut to find another hole. Now, this by itself is not really a vulnerability; but since there is no real use for it, it just affects your attack surface, and ideally should be disabled. NOTE: Despite the above, OPTIONS method IS used for several legitimate purposes nowadays, for example some REST APIs require an OPTIONS request, CORS requires pre-flight requests, and so on. So there definitely are scenarios wherein OPTIONS should be enabled, but the default should still be "disabled unless required".
source: https://security.stackexchange.com/questions/21413/how-to-exploit-http-methods
HTTP Options verb can divulge config / debug data on your Web server and as such should only be permitted if it's legitimately needed. Read this post on security stack exchange
https://security.stackexchange.com/questions/21413/how-to-exploit-http-methods
REST APIs make use of Options and I believe it should remain enabled.