crossdomain.xml 中最严格的策略是否相当于根本没有?

发布于 2024-12-26 10:13:29 字数 1089 浏览 1 评论 0原文

我可以在我的服务器日志上看到一些 http 404 对于 [mydomain]/crossdomain.xml

我想知道是否添加此文件并将其配置为具有最严格的策略。也就是说:(取自 html 5 样板)

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
-<cross-domain-policy> 
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->

<!-- Most restrictive policy: -->
 <site-control permitted-cross-domain-policies="none"/> 
<!-- Least restrictive policy: -->

<!-- <site-control permitted-cross-domain-policies="all"/> <allow-access-from domain="*" to-ports="*" secure="false"/> <allow-http-request-headers-from domain="*" headers="*" secure="false"/> -->

<!-- If you host a crossdomain.xml file with allow-access-from domain="*" and don’t understand all of the points described here, you probably have a nasty security vulnerability. ~ simon willison -->
 </cross-domain-policy>

这是否相当于根本没有?

我发现与跨域误导相关的 http 404 错误,因此我想摆脱它们,以便我可以识别真实的更有效。

I can see on the logs of my server a few http 404
for [mydomain]/crossdomain.xml

I was wondering if to add therefore this file and configure it to have the most restrictive policy. That is: (taken from html 5 boilerplate)

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
-<cross-domain-policy> 
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->

<!-- Most restrictive policy: -->
 <site-control permitted-cross-domain-policies="none"/> 
<!-- Least restrictive policy: -->

<!-- <site-control permitted-cross-domain-policies="all"/> <allow-access-from domain="*" to-ports="*" secure="false"/> <allow-http-request-headers-from domain="*" headers="*" secure="false"/> -->

<!-- If you host a crossdomain.xml file with allow-access-from domain="*" and don’t understand all of the points described here, you probably have a nasty security vulnerability. ~ simon willison -->
 </cross-domain-policy>

Would it be equivalent to not having at all ?

I find the http 404 errors related to crossdomain misleading and hence I want to get rid of them so I can identify the real ones more effectively.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸢与 2025-01-02 10:13:30

不完全是。规范规定:

也就是说,根跨域策略不包含
allowed-access-from 指令或 HTTP 标头。元策略
“无”阻止使用可能存在的任何其他策略
即使开发商将它们包括在内。拥有是无效的
根跨域内的允许访问或标头策略
元策略为“none”的策略文件。如果无效的情况
策略既有“无”设置又有其他指令,“无”需要
优先,并且该网站不允许任何权限。

所以,我认为最具限制性的技术是使用“none”。

Not quite. The spec states:

In other words, the root cross-domain policy does not contain
allow-access-from directives or the HTTP headers. A meta-policy of
“none” prevents the use of any other policies that may be present
even if the developer included them. It is invalid to have
allow-access-from or a header policy within a root cross-domain
policy file with a meta-policy of “none”. In cases where an invalid
policy has both a “none” setting and other directives, “none” takes
precedence and no permissions are allowed on the site.

So, I think the most restrictive technique is to use "none".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文