# US 2009/0276835 A1 · Secure cross-domain communication for web mashups

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2009/0276835 A1
- Document ID: US20090276835A1
- Status: Published application
- Kind: A1
- Application number: 12/112,800
- Filed: 2008-04-30
- Published: 2009-11-05
- Earliest claimed: 2008-04-30
- Assignees: Microsoft Corporation
- Inventors: Collin Jackson; Jiahe Wang
- Web page: https://patentgrep.com/patent/US20090276835A1

## CPC

- G06F 21/54: by adding security routines or objects to programs
- G06F 2221/2119: Authenticating web pages, e.g. with suspicious links
- H04L 63/20: {for managing network security; network security policies in general (filtering policies H04L63/0227)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A secure cross-domain communication system and method for facilitating secure communication between a website having a web mashup and websites having content that is to be placed on the web mashup. Embodiments of the system and method set the document domain variable of the mashup website and the websites to facilitate the secure communication. Mediator frames are used as an intermediary between a top frame (containing the web mashup) and untrusted frames (containing the website content to be included in the mashup). The type of setup technique used is dependent on the number of websites being used in the mashup. Once the secure communication is established, data exchange between the top frame and the untrusted frame is dependent on the types of services that that the browser supports.

## Claims

### Claim 1

A method for communicating between a website and an untrusted website to create a web mashup on the website, comprising:
setting a domain property of the website and a domain property of the untrusted website to a same document domain to allow direct communication between the untrusted website and the website; and
passing data between the website and the untrusted website to create the web mashup on the website.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining that the web mashup uses a single website that is the untrusted website;
creating a mediator frame that points to a page on the website of the web mashup;
creating an untrusted frame that points to a throwaway sub-domain; and
using script to create an HTML script tag and appending the HTML script tag to a document in the throwaway sub-domain.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
setting a document domain variable of the mediator frame and the untrusted frame such that the mediator frame and the untrusted frame have the same document domain to allow the mediator frame and the untrusted frame to communicate directly; and
passing arbitrary script data between the top frame and the untrusted frame.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
determining that the web mashup uses multiple websites such that the untrusted website includes the multiple websites; and
determining which type of domain frame access a browser of the website uses.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
determining that the browser uses a restrictive domain frame access;
creating a mediator frame for each untrusted website; and
creating an untrusted frame inside each of the mediator frames.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
setting a document domain variable of each of the mediator frames and each of the untrusted frames such that the mediator frames and the untrusted frames have the same document domain to allow the mediator frames and the untrusted frames to communicate directly; and
passing arbitrary script data between the top frame and each of the untrusted frames.

### Claim 7 (depends on 4)

The method of claim 4, further comprising:
determining that the browser uses a permissive domain frame access; and
creating a mediator frame.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
creating an untrusted frame inside the top frame such that the mediator frame and the untrusted frame are siblings;
adding an access frame inside the untrusted frame; and
using the access frame to obtain a “container” script object from the untrusted frame.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
setting a document domain variable of the mediator frame and the access frame such that the mediator frame and the access frame have the same document domain to allow the mediator frame and the access frame to communicate directly;
placing a script communication object in the “container” script object that the access frame shares with the untrusted frame;
using the untrusted frame to dispose of the access frame; and
using the script communication object in the untrusted frame to communicate with the top frame.

### Claim 10 (depends on 7, 8, 9)

The method of claim 9, further comprising:
repeating the above procedure in claims 7-9 for each of the untrusted websites;
disposing of the mediator frame; and
using the top frame to issue a command to load the untrusted content into each of the frames.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
determining which type of domain code authorization a browser on the website uses; and
exchanging data between the website and the untrusted website based on the type of domain code authorization of the browser.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
determining that the browser uses a static type of domain code authorization; and
using a callback technique or a polling technique to exchange data between the website and the untrusted website.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
determining that the browser uses a dynamic type of domain code authorization; and
using a polling technique to exchange data between the website and the untrusted website.

### Claim 14

A method for creating a web mashup containing different frames that are in different domains and have different websites, comprising:
determining whether the web mashup contains a single website or multiple websites;
if the web mashup contains multiple websites, determining which type of cross-domain frame access a browser of the web mashup supports;
determining which type of cross-domain code authorization the browser supports; and
enabling direct communication between the web mashup and the different frames in different domains without modifying the browser such that the web mashup is created.

### Claim 15 (depends on 14)

The method of claim 14, further comprising:
determining that the web mashup contains a single website;
performing a single web setup technique further comprising:
creating a mediator frame and an untrusted frame in the mediator frame;
creating a JScript® communication object in a top frame containing the browser and the web mashup;
passing the communication object to the mediator frame;
setting a document domain variable of the mediator frame and the document domain variable of the untrusted frame such that the mediator frame and the untrusted frame have identical document domains to allow the mediator frame to communicate directly with the untrusted frame;
passing the communication object obtained from the top frame to the untrusted frame using the mediator frame;
passing arbitrary JScript® data between the top frame and the untrusted frame using the same communication object;
if the browser uses a static cross-domain code authorization, then using a callback technique to exchange data between the top frame and the untrusted frame; and
if the browser uses a dynamic cross-domain code authorization, then using a polling technique to exchange data between the top frame and the untrusted frame.

### Claim 16 (depends on 14)

The method of claim 14, further comprising:
determining that the web mashup contains multiple websites;
determining that the browser uses a restrictive cross-domain frame access;
performing a top-mediator untrusted setup technique, further comprising:
creating a mediator frame for each of the untrusted websites and creating an untrusted frame inside each of the mediator frames;
creating a JScript® communication object in a top frame containing the browser and the web mashup;
passing the communication object to each of the mediator frames;
setting a document domain variable of each of the mediator frames and a document domain variable of each of the untrusted frames such that the mediator frames and the untrusted frames have identical document domains to allow the mediator frames to communicate directly with the untrusted frames;
using the mediator frames to pass the communication object obtained from the top frame to the untrusted frames;
passing arbitrary JScript® data between the top frame and the untrusted frame using the same communication object;
if the browser uses a static cross-domain code authorization, then using a callback technique to exchange data between the top frame and the untrusted frames; and
if the browser uses a dynamic cross-domain code authorization, then using a polling technique to exchange data between the top frame and the untrusted frames.

### Claim 17 (depends on 14)

The method of claim 14, further comprising:
determining that the web mashup contains multiple websites;
determining that the browser uses a permissive cross-domain frame access;
performing a top-untrusted access setup technique, further comprising:
creating a mediator frame and creating a JScript® communication object in a top frame containing the browser and the web mashup;
retrieving the communication object from the top frame and passing the communication object to the mediator frame;
creating an untrusted frame inside the top frame such that the mediator frame and the untrusted frame are siblings;
adding an access frame inside the untrusted frame;
using the access frame to obtain a “container” JScript® object from the untrusted frame;
changing a domain name of the access frame;
using the access frame to obtain a communication object from the mediator frame;
placing the communication object in the “container” object that the access frame shares with the untrusted frame;
using the untrusted frame to dispose of the access frame;
using the communication object in the untrusted frame to communicate directly with the top frame;
repeating the above top-untrusted access setup technique for each untrusted frame corresponding to each of the multiple websites;
disposing of the mediator frame;
using the top frame to issue a command to load untrusted content into each of the untrusted frames;
if the browser uses a static cross-domain code authorization, then using a callback technique to exchange data between the top frame and the untrusted frames; and
if the browser uses a dynamic cross-domain code authorization, then using a polling technique to exchange data between the top frame and the untrusted frames.

### Claim 18

A method for securely combining data from an untrusted website to generate a web mashup at a website having a top frame and a browser in the top frame, comprising:
creating a hidden mediator frame that points to a page on the top frame;
creating an untrusted frame inside the mediator frame that points to a page on the untrusted website;
setting a document domain variable of the mediator frame and a document domain variable of the untrusted frame to the same document domain so as to allow the mediator frame and the untrusted frame to communicate directly using a communication object;
passing the communication object from the top frame to the untrusted frame using the mediator frame;
passing data between the top frame and the untrusted frame using the communication object; and
combining data from the untrusted website to generate the web mashup.

### Claim 19 (depends on 18)

The method of claim 18, further comprising:
determining that the browser supports a static cross-domain code authorization;
using a callback technique to exchange the data between the top frame and the untrusted frame, further comprising:
using the untrusted frame to add a data request closure function to the communication object;
using the data request closure function to dynamically insert a script tag into the untrusted frame that points to some data that is hosted on the untrusted website; and
invoking the data request closure function to return data to the top frame after the script tag is finished loading the data from the untrusted website.

### Claim 20 (depends on 18)

The method of claim 18, further comprising:
determining that the browser supports a dynamic cross-domain code authorization;
using a polling technique to exchange the data between the top frame and the untrusted frame, further comprising:
polling a property of the communication object using the setinterval function to determine whether the untrusted website has data to transmit; and
if there is data to transmit, then exchanging the data between the top frame and the untrusted website.
