漏洞修复:Often Misused: HTTP Method Override

描述

In order to protect access to various resources, web servers may be configured to prevent the usage of specific HTTP verbs. However, some web frameworks provide a way to override the HTTP method in the request by supplying specific HTTP request headers. This feature is typically used when a web or proxy server restricts certain verbs, but the application needs to use them, especially in RESTful services. It is possible for a malicious user to take advantage of this feature to bypass HTTP verbs restrictions implemented on a server. Doing so may allow the attacker to perform unintended actions on protected resources in the web application.

解决方案

nginx
在server下添加

set $method $request_method;
proxy_method $method;

例如:

server{
    set $method $request_method;
    proxy_method $method;
}

思路

默认只用request的进行请求,无视header
其他思路,也可以移除header
使用nginx模块headers-more-nginx-module移除

X-Http-Method-Override
X-Method-Override
X-HTTP-Method

这3个header

参考

https://vulncat.fortify.com/en/detail?id=desc.dynamic.xtended_preview.often_misused_http_method_override
https://stackoverflow.com/questions/66032991/how-do-i-ensure-that-x-http-method-headers-are-ignored
https://docs.uipath.com/installation-and-upgrade/lang-zh_CN/docs/disabling-the-http-method-override-request
http://fandry.blogspot.com/2012/03/x-http-header-method-override-and-rest.html
https://mdnice.com/writing/09441b48b09a4e4f9db64203c95ce7f9

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值