Long before the World Wide Web Consortium (W3C) formalized Cross-Origin Resource Sharing (CORS), the web was already deeply interconnected through interactive Adobe Flash applications. Flash developers faced a fundamental dilemma: how could an SWF application hosted on a Content Delivery Network securely consume REST APIs, asset bundles, and multiplayer streams hosted on separate domain infrastructures? Flash answered this challenge with crossdomain.xml, creating the conceptual blueprint for modern browser security sandboxes.
1. The Same-Origin Policy & The Flash Plugin Boundary
The browser's Same-Origin Policy (SOP) is the bedrock of client-side web security. It dictates that scripts running in one origin (defined by the tuple of scheme, hostname, and port) cannot read sensitive document content or HTTP responses originating from a different origin.
In the era of Flash Player 6 through Flash Player 9, the browser delegated network execution to the NPAPI or ActiveX Flash plugin. Because Flash was capable of initiating raw HTTP requests (via URLLoader) as well as low-level TCP streaming sockets (via XMLSocket and Socket), Adobe had to engineer a policy enforcement layer that prevented malicious third-party SWFs from executing unauthorized intranet probing or exfiltrating private user data.
API Server checks /crossdomain.xml → Grants or Denies Access → Flash Player enforces boundary
2. Anatomy of crossdomain.xml & Master Policy Enforcement
A crossdomain.xml file is an XML document placed at the root directory of a web server (e.g., https://api.example.com/crossdomain.xml). When an SWF application attempted to read data from that server, the Flash Player automatically halted the request and dispatched a silent HTTP GET request for the root policy document.
A standard production policy file declared site-control permissions, whitelisted origins, allowed HTTP request headers, and transport security constraints:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Restrict secondary policy files from overriding master rules -->
<site-control permitted-cross-domain-policies="master-only"/>
<!-- Whitelist trusted origins explicitly -->
<allow-access-from domain="*.trusted-portal.com" secure="true"/>
<allow-access-from domain="app.company.com" secure="true"/>
<!-- Permit custom authorization headers -->
<allow-http-request-headers-from domain="*.trusted-portal.com" headers="Authorization, X-Requested-With"/>
</cross-domain-policy>
Starting in Flash Player 9.0.124.0, Adobe hardened the policy architecture by introducing the <site-control> tag. If the master policy file specified permitted-cross-domain-policies="master-only", child directories were strictly barred from serving their own permissive policy files, preventing unprivileged users who could upload files to user-generated directories from escalating cross-domain privileges.
3. Socket Policy Servers & The Port 843 Protocol
While HTTP policies resided over standard port 80 or 443, raw TCP sockets (flash.net.Socket) presented severe security risks: a rogue SWF could weaponize the victim's browser as a botnet proxy to attack internal intranet databases (such as Redis or MySQL) that did not require authentication.
To mitigate this, Flash Player enforced the Master Socket Policy rule on privileged TCP port 843. Before opening any socket to target-host.com:9000, the Flash runtime paused execution and attempted a TCP handshake with target-host.com:843:
- The Flash Player client transmitted the exact probe string:
<policy-file-request/>