Cross domain data hijacking


This page is possibly vulnerable to Cross domain data hijacking. If an attacker can create/upload a malicious Flash (SWF) file or control the top part of any page he can perform an attack known as Cross domain data hijacking. The Content-Type of the response doesn't matter. If the file is embedded using an <object> tag, it will be executed as a Flash file as long as the content of the file looks like a valid Flash file.

Here is the attack scenario:

  • An attacker creates a malicious Flash (SWF) file
  • The attacker changes the file extension to JPG
  • The attacker uploads the file to
  • The attacker embeds the file on using an tag with type "application/x-shockwave-flash"
  • The victim visits, loads the file as embedded with the tag
  • The attacker can now send and receive arbitrary requests to using the victims session
  • The attacker sends a request to and extracts the CSRF token from the response

There are many ways to perform this attack. The attacker doesn't need to upload a file. The only requirement is that an attacker can control the data on a location of the target domain. One way is to abuse a JSONP API. Usually, the attacker can control the output of a JSONP API endpoint by changing the callback parameter. However, if an attacker uses an entire Flash file as callback, we can use it just like we would use an uploaded file in this attack.

A payload could look like this:
<object style="height:1px;width:1px;" data="" type="application/x-shockwave-flash" allowscriptaccess="always" flashvars="c=alert&u="></object>


For file uploads: It is recommended to check the file's content to have the correct header and format. If possible, use "Content-Disposition: attachment; filename=Filename.Extension;" header for the files that do not need to be served in the web browser. Isolating the domain of the uploaded files is also a good solution as long as the crossdomain.xml file of the main website does not include the isolated domain.

For other cases: For JSONP abuses or other cases when the attacker control the top part of the page, you need to perform proper input filtering to protect against this type of issues.

  • Configuration