Permissive Cross-domain Security Policy with Untrusted Domains

Incomplete Variant
Structure: Simple
Description

The product uses a web-client protection mechanism such as a Content Security Policy (CSP) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate.

Extended Description

If a cross-domain policy file includes domains that should not be trusted, such as when using wildcards under a high-level domain, then the application could be attacked by these untrusted domains. In many cases, the attack can be launched without the victim even being aware of it.

Common Consequences 1
Scope: ConfidentialityIntegrityAvailabilityAccess Control

Impact: Execute Unauthorized Code or CommandsBypass Protection MechanismRead Application DataVaries by Context

With an overly permissive policy file, an attacker may be able to bypass the web browser's same-origin policy and conduct many of the same attacks seen in Cross-Site Scripting (Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')). An attacker can exploit the weakness to transfer private information from the victim's machine to the attacker, manipulate or steal cookies that may include session information, create malicious requests to a web site on behalf of the victim, or execute malicious code on the end user systems. Other damaging attacks include the disclosure of end user files, installation of Trojan horse programs, redirecting the user to some other page or site, running ActiveX controls (under Microsoft Internet Explorer) from sites that a user perceives as trustworthy, and modifying presentation of content.

Detection Methods 1
Automated Static AnalysisHigh
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Potential Mitigations 3
Phase: Architecture and DesignOperation

Strategy: Attack Surface Reduction

Define a restrictive Content Security Policy [REF-1486] or cross-domain policy file.
Phase: Architecture and DesignOperation

Strategy: Attack Surface Reduction

Avoid using wildcards in the CSP / cross-domain policy file. Any domain matching the wildcard expression will be implicitly trusted, and can perform two-way interaction with the target server.
Phase: Architecture and DesignOperation

Strategy: Environment Hardening

For Flash, modify crossdomain.xml to use meta-policy options such as 'master-only' or 'none' to reduce the possibility of an attacker planting extraneous cross-domain policy files on a server.
Demonstrative Examples 1

ID : DX-208

These cross-domain policy files mean to allow Flash and Silverlight applications hosted on other domains to access its data:
Flash crossdomain.xml :

Code Example:

Bad
XML
xml
Silverlight clientaccesspolicy.xml :

Code Example:

Bad
XML
xml
These entries are far too permissive, allowing any Flash or Silverlight application to send requests. A malicious application hosted on any other web site will be able to send requests on behalf of any user tricked into executing it.
Observed Examples 5
CVE-2012-2292Product has a Silverlight cross-domain policy that does not restrict access to another application, which allows remote attackers to bypass the Same Origin Policy.
CVE-2014-2049The default Flash Cross Domain policies in a product allows remote attackers to access user files.
CVE-2007-6243Chain: Adobe Flash Player does not sufficiently restrict the interpretation and usage of cross-domain policy files, which makes it easier for remote attackers to conduct cross-domain and cross-site scripting (XSS) attacks.
CVE-2008-4822Chain: Adobe Flash Player and earlier does not properly interpret policy files, which allows remote attackers to bypass a non-root domain policy.
CVE-2010-3636Chain: Adobe Flash Player does not properly handle unspecified encodings during the parsing of a cross-domain policy file, which allows remote web servers to bypass intended access restrictions via unknown vectors.
References 6
Content Security Policy Cheat Sheet
OWASP
ID: REF-1486
Setting a crossdomain.xml file for HTTP streaming
Apurva Udaykumar
Adobe
19-11-2012
ID: REF-943
Cross-domain policy for Flash movies
Adobe
Adobe
ID: REF-944
HTTP Communication and Security with Silverlight
Microsoft Corporation
ID: REF-945
Network Security Access Restrictions in Silverlight
Microsoft Corporation
ID: REF-946
Analyzing the Crossdomain Policies of Flash Applications
Dongseok Jang, Aishwarya Venkataraman, G. Michael Sawka, and Hovav Shacham
05-2011
ID: REF-947
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Technologies:
Web Based : Undetermined
Modes of Introduction
Implementation
Architecture and Design