Modern web security goes beyond safeguarding web applications solely from common threats like SQL injection or cross-site scripting (XSS). In certain scenarios—particularly those involving legacy technologies like Adobe Flash Player, Microsoft Silverlight, or even Adobe Acrobat—cross-domain policy files can inadvertently expose resources across different origins.
X-Permitted-Cross-Domain-Policies is an HTTP response header that specifies if and how cross-domain policy files can be loaded from a particular host. It acts as a meta-policy to control access to resources across different domains, particularly for legacy applications.
Completely prohibits all cross-domain policy files. The server effectively disallows legacy clients from using any policy files to load resources.
Only the primary (or "master") policy file in the root directory is allowed. Sub-policy files in other directories will be ignored.
Restricts valid policy files to those served with the specific MIME type text/x-cross-domain-policy.
Only allows policy files named crossdomain.xml (primarily relevant for FTP-based hosting environments).
Permits policy files from any location on the domain. This is the most permissive setting and is usually discouraged.
Without proper configuration, maliciously uploaded or modified crossdomain.xml files might allow unauthorized cross-domain resource requests.
Enterprise setups with legacy technologies may be vulnerable to exploits in cross-domain policy implementations.
Overlooking these policy files can lead to failing security audits or tool-based checks.
<IfModule mod_headers.c>
Header set X-Permitted-Cross-Domain-Policies "none"
</IfModule>
LoadModule headers_module modules/mod_headers.so
server {
listen 80;
server_name example.com;
add_header X-Permitted-Cross-Domain-Policies "none";
# Other configuration directives...
}
nginx -t
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Permitted-Cross-Domain-Policies"
value="none" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Although X-Permitted-Cross-Domain-Policies focuses on older technologies, modern browsers typically rely on CORS for managing cross-origin requests. Properly implementing both CORS and X-Permitted-Cross-Domain-Policies helps ensure comprehensive protection.
If your application strictly uses JavaScript-based front ends, setting X-Permitted-Cross-Domain-Policies to "none" serves as a best-practice safeguard against any inadvertent or malicious policy file additions.
Official documentation on cross-domain policy files and their implementation
Comprehensive guide on implementing secure headers including X-Permitted-Cross-Domain-Policies
Modern approach to cross-origin requests and how they relate to legacy solutions
Learn about other HTTP security headers to strengthen your website's security: