We try our best to keep ClipAndFile secure but there are some rules that you should consider following to keep your site safe.
For the existing configuration options available for security, see Configuration Options.
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
ClipAndFile
object itself is not globally accessible. - The
ClipAndFile.prototype
object itself is not globally accessible. - No
ClipAndFile
instances are globally accessible. - No callback functions for dispatched ClipAndFile events are globally accessible.
- If a variable is used to set the path to the SWF via
ClipAndFile.config
, that variable must not be globally accessible. - The DOM is not accessible (due to built-in support for
data-clipboard-text
anddata-clipboard-target
attributes).
- Having
ClipAndFile
instances globally accessible (versus encapsulated in a closure). This allows an attacker to manually call a client'ssetText
method 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
ClipAndFile
orClipAndFile.prototype
properties or methods, if globally accessible. - Adding
data-clipboard-text
ordata-clipboard-target
attributes to every element in the DOM.
If you find any security holes that you believe can be patched, please submit a pull request or file an issue. We will be very appreciative!