azure - 由于 X-ORIGINAL-URL 标头(CVE-2018-14773),Cloudflare 阻止了我们的“子域之间”url 重写为 403
问题描述
问题:如何删除Azure ARR中的X-ORIGINAL-URL标头?
由于 X-ORIGINAL-URL 标头 (CVE-2018-14773),Cloudflare 使用 403 阻止了我们的“子域之间”url 重写。
我们正在使用 applicationHost.xdt 文件并在 web.config 中重写规则。
规则是:
<rule name="Rule" stopProcessing="true">
<match url="^(ab|cd|ef|gh)/(.*)" />
<conditions logicalGrouping="MatchAny">
<add matchType="Pattern" input="{HTTP_HOST}" pattern="^sub\.domain\.com$" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
<action type="Rewrite" url="https://sub.{R:1}.domain.com/{R:2}" appendQueryString="false" logRewrittenUrl="true" />
</rule>
应用程序主机.xdt:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<proxy xdt:Transform="InsertIfMissing" enabled="true" preserveHostHeader="false" reverseRewriteHostInResponseHeaders="false" />
</system.webServer>
<location path="%XDT_SITENAME%" xdt:Locator="Match(path)">
<system.webServer xdt:Transform="InsertIfMissing">
<httpProtocol xdt:Transform="InsertIfMissing">
<customHeaders xdt:Transform="InsertIfMissing">
<add xdt:Transform="Remove" />
</customHeaders>
</httpProtocol>
<rewrite xdt:Transform="InsertIfMissing">
<allowedServerVariables xdt:Transform="InsertIfMissing" >
<add name="HTTP_X_ORIGINAL_HOST" xdt:Transform="InsertIfMissing" />
<add name="HTTP_HOST" xdt:Transform="InsertIfMissing" />
<add name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" />
<add name="HTTP_ACCEPT_ENCODING" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" />
</allowedServerVariables>
</rewrite>
</system.webServer>
</location>
</configuration>
Cloudflare 日志(部分):
{
"key": "rule_message",
"value": "Drupal, Wordpress - Anomaly:Header:X-Original-Url, Anomaly:Header:X-Rewrite-Url - CVE:CVE-2018-14773"
},
解决方案
推荐阅读
- azure - Azure 数据工厂数据流任务不能以 prem 作为源
- python - Function declaring global variable doesn't work in debug mode
- python - python相当于curl命令,具有api令牌基本身份验证
- pseudocode - 必须逐行读取伪代码并解析输入的行
- php - $_SERVER 中的 PATH_INFO 始终为空 - NGINX + FPM 7.3 + Ubuntu 18.04
- javascript - 同时向 ChartJS 图表添加和删除数据
- r - 出现错误:UseMethod(“内容”,x)中的错误:没有适用于“内容”的方法应用于“字符”类的对象
- javascript - 如何使 JavaScript 类或函数能够使以下代码工作?我不能使用承诺和等待
- javascript - 为什么会出现错误:下载 node.js 后找不到模块?
- wcf - System.ServiceModel.AddressAlreadyInUseException:HTTP 无法注册 URL http://+:8733/Design_Time_Addresses/WcfService/MathOperationService/