cross site integration “mashups” cross site scripting

19
Cross Site Integration “mashups” cross site scripting

Upload: clement-stewart

Post on 01-Jan-2016

231 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Cross Site Integration “mashups” cross site scripting

Cross Site IntegrationCross Site Integration

“mashups”cross site scripting

Page 2: Cross Site Integration “mashups” cross site scripting

Server SideServer code fetches data or services

Has little to do with this course

Can involve XML or SQL to remote servers

Data may include HTML

Data may include javascript

Man-in-the-middle attacks?

Page 3: Cross Site Integration “mashups” cross site scripting

3rd PartyDo you trust them?

When they update will it break you?

When they go broke will it break you?

Do they send any javascript code or URLs used in links?

javascript can do ANYTHING to you

URLs can send people to fake sites

Page 4: Cross Site Integration “mashups” cross site scripting

AJAXprotocol is XML (SOAP)

data is often XML

Based upon hack of invisible frames

HTML pages read by javascript

Most often used in a framework which just lifts HTML fragments from the data

Page 5: Cross Site Integration “mashups” cross site scripting

AJAXSecurity limitations are similar to javascripting frames

Same website policy!

can’t load external data

server-side data relays

Easy access to XML data sources

XML is powerful…

Page 6: Cross Site Integration “mashups” cross site scripting

Examples?Libraries are always used: jQuery, etc

Requires server side program

Requires some XML data

this could be a minimal wrapper

http://www.w3schools.com/AJAX

http://www.ajaxdaddy.com

Page 7: Cross Site Integration “mashups” cross site scripting

IssuesDO NOT OVER DO IT!

High server load / High bandwidth

slow XML over slow HTTP

Server relay needs bandwidth

Utilizing XML may be work

XML processing is cpu intensive

Page 8: Cross Site Integration “mashups” cross site scripting

3rd PartyDo you trust them?

When they update will it break you?

When they go broke will it break you?

Do they send any javascript code or URLs used in links?

javascript can do ANYTHING to you

URLs can send people to fake sites

Page 9: Cross Site Integration “mashups” cross site scripting

Javascript

Almost no security limitations

exec() of code can be limited to making objects

JSON (JavaScript Object Notation)

easier, smaller, faster than XML

Code is more powerful / flexible

Page 10: Cross Site Integration “mashups” cross site scripting

JSONFor speed and size most use JSON

code can be written in JSON

most code libraries are in JSON

APIs not uniform!

Heavily depend on browser garbage collection - once script is loaded you can’t unload it

Page 11: Cross Site Integration “mashups” cross site scripting

Variable Methodvar o = {json &could include code};

var x = “stringified code”;

var loaded=1;

loading function looks for loaded==1

o: loop object & copy or exec

x: exec() runs the string

Page 12: Cross Site Integration “mashups” cross site scripting

Wrappedjavascript code sent as string data

wrap in HTML (invisible frame or part of a visible frame)

wrap in AJAX

This delays running the SCRIPT so you can “securely” exec it or parse it

Page 13: Cross Site Integration “mashups” cross site scripting

Library StyleProvides a set of functions to do what needs to be done

often handle loading of JSON (or AJAX)

Function parameters used for customization

CSS of the generated HTML

Page 14: Cross Site Integration “mashups” cross site scripting

Exampleshttp://disqus.com

Online comments, no javascript API

CSS to format, just a SCRIPT file

http://www.google.com/ig/directory?synd=open

Google gadgets js scripts

Some have API

Page 15: Cross Site Integration “mashups” cross site scripting

API/Globals/QueryAPI- their javascript interface (trust?)

You call their functions with settings

Globals- you define objects with the settings before running their code

Query - you send settings in the Query part of requesting the data

Page 16: Cross Site Integration “mashups” cross site scripting

3rd PartyDo you trust them?

When they update will it break you?

When they go broke will it break you?

Do they send any javascript code or URLs used in links?

javascript can do ANYTHING to you

URLs can send people to fake sites

Page 17: Cross Site Integration “mashups” cross site scripting

Google Maps1st to popularize rich javascript applications

Has a Javascript API - add your own points on the map

Was early to popularize “mashups” combining datasets with location datahttp://code.google.com/apis/maps/documentation/javascript/

Page 18: Cross Site Integration “mashups” cross site scripting

Plug-ins

Flash, Silverlight, A/V, ActiveX

Browser plugs have little security

Plug-ins may have javascript APIs

Plug-ins may have their OWN scripting (flash uses javascript)

Page 19: Cross Site Integration “mashups” cross site scripting

ExamplesYoutube embedded

Paste-in HTML code

Basically its a flash plug-in embed

External video / audio content

Quicktime, <video>, etc

“super” cookies - use plug-ins to circumvent privacy