如何解决由于X-ORIGINAL-URL标头,Cloudflare使用403阻止了我们的“子域之间” URL重写CVE-2018-14773
问题:如何在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>
applicationHost.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"
},
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。