We try our best to keep ZeroClipboard secure but there are some rules that you should follow to keep your site safe.
Basically, if an attacker gets access to the main window/global object via an XSS exploit, it's pretty much an instant "GAME OVER" unless ALL of the following are true:
- The
ZeroClipboardobject itself is not globally accessible. - The
ZeroClipboard.prototypeobject itself is not globally accessible. - No
ZeroClipboardinstances are globally accessible. - No callback functions for dispatched ZeroClipboard events are globally accessible.
- If a variable is used to set the path to the SWF via
ZeroClipboard#setDefaults, that variable must not be globally accessible.
- Having
ZeroClipboardinstances globally accessible (versus encapsulated in a closure). This allows an attacker to manually call a client'ssetTextmethod and inject their own text. - As with all globally accessible functions in JavaScript, any globally accessible callback functions (hooked to events) can be overridden by an attacker. This isn't terribly dangerous but could be annoying.
- Overriding any of the
ZeroClipboardorZeroClipboard.prototypeproperties or methods, if globally accessible.
If you find any security holes, please submit a pull request, or file an issue. We will be very appreciative.