javascript - Securing script injection and execution on third party iframes -


i want able inject scripts iframed page (hosted on 3rd party server) within page served out of own server (to visualize changes wysiwygapp).

since have small stub script on 'target' page, guess have method allows arbitrary script execution of whatever passed it. doesnt sound secure, since open attack vector neat xss. 1 of ideas had securing passing sort of token alongside scripts want run, stub client code check server, , execute scripts. make sense? point me precedents perhaps?

many thanks

first off, sounds control small amount of code in actual iframe. rather proposal of allowing others inject script via stub (which open sorts of attacks), why don't put actual "safe" code want in iframe , notify parent frame of results?

second off, there zillion web pages written safe cross-domain iframe communication. since i'm still not sure you're trying do, may need searching , find mechanism works best you. google search "safe cross domain iframe communication" finds ton of information.

third, article came across , liked best cross domain communication iframes , safest technique looks postmessage because shares data only, doesn't allow code calling , can check origins trusts, though postmessage available in newer browsers have fall 1 of other techniques works in older browsers too. here's jquery plugin uses postmessage when available , falls technique when not.

if info isn't enough, please tell more you're trying in iframe or information you're trying pass between 2 origins?


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -